Hi,
How do i hide the expand Button (+/-) on a grid but still can expand a row with left/right keys?
Greetings,
Filip Moons
How do i hide the expand Button (+/-) on a grid?
Answers approved by DevExpress Support
Hi Filip,
I've slightly modified your code.
Please review the attached sample and inform me whether it meets your requirements.
Thanks,
Dimitros
Hi Filip,
Please review the following Knowledge Base article to learn how to achieve the desired result:
"How to hide the Expand buttons for grouping rows"
Article ID:A871 (http://www.devexpress.com/kb=A871)
Feel free to contact us if you need any further assistance on this item.
Thanks,
Dimitros
Hi,
I need this functionality for a TcxGridMasterDataRow not TcxGridGroupRow. I applied the same logic for TcxGridMasterDataRow but that doesn't work. Maybe i wasn't clear what i wanted, i just want to hide the [+/-] button but still have the ability to expand the row with Left/Right keys.
with Result := not RecordInfo.Expanded in function TcxACGridMasterDataRow.GetExpandable i can expand the row but the button still show
with Result := False in function TcxACGridMasterDataRow.GetExpandable the button doesn't show but the row doesn't expand either
Second our grids are on inherited forms, which means all logic applied on the designtime view need to reapplied to the new view. That's alot off work just to hide (not show) a button…
Greetings,
Filip Moons
type TcxACGridDBBandedTableView = class(TcxGridDBBandedTableView) protected function GetViewDataClass: TcxCustomGridViewDataClass; override; end; TcxACGridViewData = class(TcxGridViewData) protected function GetRecordClass(ARecordInfo: TcxRowInfo): TcxCustomGridRecordClass; override; end; TcxACGridMasterDataRow = class(TcxGridMasterDataRow) protected function GetExpandable: Boolean; override; end; function TcxACGridDBBandedTableView.GetViewDataClass: TcxCustomGridViewDataClass; begin Result := TcxACGridViewData; end; {GetViewDataClass} { TcxACGridViewData } function TcxACGridViewData.GetRecordClass(ARecordInfo: TcxRowInfo): TcxCustomGridRecordClass; begin Result := inherited GetRecordClass(ARecordInfo); if Result = TcxGridMasterDataRow then Result := TcxACGridMasterDataRow; end; {GetRecordClass} { TcxACGridMasterDataRow } function TcxACGridMasterDataRow.GetExpandable: Boolean; begin Result := not RecordInfo.Expanded; end; {GetExpandable} procedure TFCT96100F.FormCreate(Sender: TObject); var AView: TcxACGridDBBandedTableView; begin AView := TcxACGridDBBandedTableView(Grid.CreateView(TcxACGridDBBandedTableView)); AView.Assign(GridView); GridLevel.GridView := AView; end; {FormCreate}