Ticket T355716
Visible to All Users

Gridband and how to get a different heading for a list in a list

created 9 years ago

Dear sir, dear madam,

I have got a grid, in which one I like to get a different heading without a GridBand for a List, which is included into a List with a GridBand as their heading. To get a chance to know, what I mean, I included a sample to this issue.

I like to get a view like this:

GridBand to Test
Barcode Status IDNo
4711 2001 -15
     Barcode2 Value
     4711-1 Hello User
     4711-2 What a wonderfull day
4712 2002 -15
     Barcode2 Value
     4712-21 I am looking
    4712-22 for a solution

If you need more information, please contact me.

With regards,

Andreas

Comments (2)
DevExpress Support Team 9 years ago

    Hello Andreas,

    Thank you the sample.
    To avoid misunderstanding, would you please provide us with a screenshot to illustrate the required behavior? This information will allow us to find a suitable solution quickly.
    I am looking forward to your reply.

    AV AV
    Andreas Voßhenrich 9 years ago

      Hello Alexey,

      I attached a picture to show you, how I imagine a solution. The heading of the sub-table has to be displayed without gripband. I hope, that my request is now more comprehensible for you.

      With regards,

      Andreas

      Answers approved by DevExpress Support

      created 9 years ago (modified 8 years ago)

      Hello Andreas,
      To achieve the required result, you can either handle the GridView.MasterRowExpanded event in the following manner:

      C#
      private void advBandedGridView1_MasterRowExpanded(object sender, DevExpress.XtraGrid.Views.Grid.CustomMasterRowEventArgs e) { AdvBandedGridView detailView = (sender as AdvBandedGridView).GetDetailView(e.RowHandle, e.RelationIndex) as AdvBandedGridView; detailView.Bands["gridBand2"].Visible = false; }

      or create a separate detail view and configure it as required. Please refer to the Views and Levels article to know how to do that.

      I hope this information is helpful. Let me know if you have additional questions.

        Show previous comments (1)
        DevExpress Support Team 9 years ago

          The simplest way to achieve the required result is to create a view using Level Designer  and handle the RowStyle  event.
          I've created a sample project to demonstrate how this works. I'd also note that in this case there is no need to handle the MasterRowExpanded event for the main view.
          Please review the project and let me know if you have additional questions.

          AV AV
          Andreas Voßhenrich 9 years ago

            Hi Stas,

            this is a great result. Thank you very much.

            Regards,

            Andreas

            DevExpress Support Team 9 years ago

              You're welcome!

              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.