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

Grouping entire GGC from Detail record

I have the following scenario, I have a master/detail relationship between 2 tables. I want to be able to use a Grid Grouping Control to show this relationship in a hierarchical manner. (No problems so far) The catch is that I want to be able to group the entire grid by selecting a column from the detail group. The only way I have found to do this is to flatten my tables using the ForeignKey relationship. This is functionally correct, but I would like to keep my presentation in a hierarchical format. For the visually inclined here''s what I have: CityID | City | State | Zip ----- Address1 | Address 2 | CityID I would like to be able to group Cities by Address1 (contrived I know) I would like to be able to grab Is this possible? If so how, if not why :)

8 Replies

AD Administrator Syncfusion Team October 3, 2005 03:55 PM UTC

Try adding the column to the ChildTableDescriptor''s GroupedColumns collection. //"ParentToChild" is name of the relation //"Address1" is column in child this.hierarchyGrid.TableDescriptor.Relations["ParentToChild"].ChildTableDescriptor.GroupedColumns.Add("Address1");


JM Jay Mooney October 3, 2005 04:46 PM UTC

>Try adding the column to the ChildTableDescriptor''s GroupedColumns collection. > >//"ParentToChild" is name of the relation >//"Address1" is column in child >this.hierarchyGrid.TableDescriptor.Relations["ParentToChild"].ChildTableDescriptor.GroupedColumns.Add("Address1"); > Thanks for the reply, it doesn''t quite do what I was looking for though. Adding "Address" to the child''s group column collection does organize the details, but the master record is still unaffected.


AD Administrator Syncfusion Team October 3, 2005 06:50 PM UTC

I am not sure how this would work if there are 15 different Address detail records under the same master record. Do you expect he Master record repeated 15 times? If the above one master to many details is not a problem, then you could try adding an unbound columns (using the gridMaster.TableDescriptor.UnboundColumns collection), and then in the QueryValue event that populates this unbound colunmn, you can provide teh Address detail value you want associated with this master record. The you could group by this unbound column. If you do not want to see it, you could also remove it from the gridmaster.TableDescriptor.VisibleColumns collection.


JM Jay Mooney October 3, 2005 06:53 PM UTC

Thank you. I''m not sure on the record dynamics. I''ll check into it to see if we have a one to many scenario. I''ll give your suggestion a try and see how it applies to my scenario. Then I''ll post the results :)


JM Jay Mooney October 3, 2005 09:42 PM UTC

No dice. That works for a single column, but is not generic enough to work with multiple child columns.


AD Administrator Syncfusion Team October 4, 2005 12:29 AM UTC

Jay, check out the ProductRatings example. It shows a m:n relation when you group by rating. Products can have multiple ratings by different customers and when you group by rating the product can appear in more than one category. Stefan


JM Jay Mooney October 4, 2005 01:40 PM UTC

Thanks.


JM Jay Mooney October 4, 2005 02:26 PM UTC

I just got done testing. this works perfectly. Thank both of you very much!!! (please excuse the excessive personality, family trait :))

Loader.
Live Chat Icon For mobile
Up arrow icon