We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

GridDataBoundGrid Relations?

I have a question about using the relations from a dataset I have in my app... Right now I don''t know how to go about using them properly and I''m using a work around where I build a new table that references all the relations to make the table I wish to display to my users... it''s rather processor intensive and takes some time. Is there some way to reference these relations and display them in the grid without having to create the new tables the way I described above? example: event table: eventID = primary key date productionID1 = foreign key productionID2 = foreign key etc... production table: productionID = primary key Name Type ticket table: ticketID = primary key eventID = foreign key qty now I want to display 2 tables that are linked... I''ve been reading and I think the grouping tools can do this for me aswell... but that''s the second part of this question. so the first table wants to display the event table dereferencing the production names from the production table... user sees in grid: Event = ProductionName1 + text + ProductionName2 Date = Date only Time = Time from the DateTime object only etc... Is this possible to accomplish this in a manner more efficient than building a new table in a thread the way I described above? Also once I did this for the Event Grid on top and the Ticket Grid on bottom... what would I need to use to reference the eventID selected on the Event Grid, to display the appropriate tickets on the Tickets Grid that are for that event? I haven''t found how to do that with the grouping tool still reading about it... Thanks

3 Replies

AD Administrator Syncfusion Team May 30, 2005 11:11 PM UTC

With the GridGroupingControl, you can add related columns to the grid from other tables. Here is a sample. http://www.syncfusion.com/Support/user/uploads/GGC_ShowTables_702496b2.zip

AD Administrator Syncfusion Team May 31, 2005 12:04 AM UTC

that works great... is there anyway to create these relations of off the ones that are already applied to the dataset?

AD Administrator Syncfusion Team May 31, 2005 01:22 AM UTC

If you want to use RelationKind.ForeignKeyReference, then you do have to add GridRelationDescriptor to the tabledescriptor Relations collection (though you can do this from the designer if you know your dataset at design time). The default relations from the dataset are RelationKind.MasterDetails type. These lead to nested tables. They do not add columns to the parent table.

Live Chat Icon For mobile
Up arrow icon