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

mapping a grouped engine to a tree-view

I have created a stand-alone Syncfusion.Grouping.Engine based on a DataView (which overlays a simple DataTable) and have added a Group on one of the Columns that contains duplicates. When I iterate through the Elements and come across a CaptionRow (CaptionSection doesn''t seem to exist) I can examine the Info property which contains a string telling me the number of Items and the group-value. 1) Now is there any way for me to get hold of this info individually?? i.e. not parsing this Info string. 2) Also, since in my sample I have got two ''groups'' how do I get hold of an individual group that I then can query for its Records? NOT going through the entire table.Elements iteration! 3) Ideally, I would like to attach this engine to a tree-view which in this example would show me two base-level nodes each with a number of sub-nodes. I want to expand these nodes on demand, thereby going back to the engine - identiying the group and iterating through its Records.

4 Replies

AD Administrator Syncfusion Team August 17, 2004 03:05 PM

Hi Marcel, When you have a CaptionRow you can query ParentGroup.GetChildCount() for that CaptionRow. ParentGroup.CategoryKeys or ParentGroup.Category will give you the category value for the specific group. To iterate through records in a group, check first if the group has records or nested groups as details. A group can either be a final node with records or it can be a node with nested groups. If a group has records, its Groups collection will be empty and the Records collection will contain all records. If a group has nested groups, its Groups collection will have the nested groups and the Records collection will be empty. To get hold of a specific group that matches a specific category key use the GroupsInDetails.FindGroup method. Example: GridGroup germanyGroup = (GridGroup) this.groupingGrid1.Table.TopLevelGroup.Groups["Germany"]; - or - int index = this.groupingGrid1.Table.TopLevelGroup.Groups.FindGroup("Germany"); if (index != -1) { Group germanyGroup2 = this.groupingGrid1.Table.TopLevelGroup.Groups[index]; Trace.WriteLine(germanyGroup2); } You can then iterate through germanyGroup.Groups and/or germanyGroup.Records We do have a TreeViewAdvDataBound sample in-house which implements pretty much what you describe below. One of our support engineers will update the direct track incident 13004 and send you the TreeViewAdvDataBound sample project. Thanks, Stefan


MA marcel August 18, 2004 02:51 AM

This worked - well again I don''t want to use the GridGroup object but normal casting to the Group class works wonders - full access now to all the groups - excellent - Thanks!


PA Panji Aryaputra February 24, 2005 10:21 PM

Hi Stefan, can you send me the TreeViewAdvDataBound sample? Thanks, Panji


AD Administrator Syncfusion Team February 25, 2005 06:58 AM

Panji, I uploaded it to our ftp site. The URL is: http://www.syncfusion.com/Support/user/uploads/GroupingTreeViewAdv.zip Stefan >Hi Stefan, can you send me the TreeViewAdvDataBound sample? > >Thanks, >Panji

Loader.
Live Chat Icon For mobile
Up arrow icon