Ticket T704669
Visible to All Users

How to show self referencing data in a single grid

created 6 years ago

Hi Guys
I have a show stopper problem and am hoping you guys can help.
This issue is  simple using our current grid provider but doesnt appear to be supported by DEV express
I have a data table made up of three columns…(in real life its actually a lot more but for this issue i only need to demonstrate 3)

GroupGroupHeader   RowGUID   SelfReferenceID
Application                      1                    1

Application                      2                    2
Application                      3                    2

Application                      4                    4
Application                      5                    4
Application                      6                    4

It should display in a grid something like the following

Application as a group
         1

2
                  3  (record 3 "belongs" to record 2 as its self reference key is 2)

4
                  5 (record 5 "belongs" to record 4 as its self reference key is 4)
                  6 (record 6 "belongs" to record 4 as its self reference key is 4) etc

Unfortunately my reading of the support tickets suggest this carnt be done in the Dev Express grid control.
Perhaps Im missing something

Thanks

Answers approved by DevExpress Support

created 6 years ago

Hi Andre,

To display a self-referenced data table, create a relation for your data table and filter the grid's data source to show only "root" records. We discussed this in the How to display a self-referenced data table via master and detail grid views thread. Review it for more information. Refer also to the How to display a self-referenced data table via master and detail grid views example illustrating this approach.
Please let us know if you have further questions.

    Show previous comments (8)
    DevExpress Support Team 6 years ago

      Hi Andre,

      Please accept my apologies for the delayed response. After examining your screenshots, I recommend that you give our TreeList control another try. I believe it will better suit your scenario. I updated Nadezhda's project to show how to set up this control for your task. Please note that I'm using the CustomDrawRow event to render "parent" rows in code so that they look as group rows. Once you've had an opportunity to test this project, let me know what you think about it.

      AC AC
      andre chevallier 6 years ago

        We have opted for an alternate solution in this case

        DevExpress Support Team 6 years ago

          Andre,

          Thank you for letting us know of your decision. We appreciate it.

          Should you have any further questions, do not hesitate to contact us.

          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.