Ticket Q105527
Visible to All Users

How do i hide the expand Button (+/-) on a grid?

created 17 years ago

Hi,
How do i hide the expand Button (+/-) on a grid but still can expand a row with left/right keys?
Greetings,
Filip Moons

Comments (2)
DevExpress Support Team 17 years ago

    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

      Delphi
      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}

      Answers approved by DevExpress Support

      created 17 years ago (modified a year ago)

      Hi Filip,
      I've slightly modified your code.
      Please review the attached sample and inform me whether it meets your requirements.
      Thanks,
      Dimitros

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.