Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1155
Group and Ungroup Programatically Expand by group Text vale
posted

I have managed to group my datagrid using the below found elsewhere on this site.

Problem: How to expand an item in the group by text value after the items have been grouped?

Issues: There is not such event as AfterGrouping and the myGrid.Grouped event does not fire if you group things programmatically.

"

Field fld = this.AreaUnitDetails.FieldLayouts[0].Fields[4]; // Type
            FieldSortDescription fsd = new FieldSortDescription();
            fsd.Field = fld;
            fsd.Direction = ListSortDirection.Ascending;
            fsd.IsGroupBy = true;           
            this.AreaUnitDetails.FieldLayouts[0].SortedFields.Add(fsd); "

            // Check the groups

            bool gbsf = this.AreaUnitDetails.FieldLayouts[0].HasGroupBySortFields;         
           
            var temp = this.AreaUnitDetails.Records.DataPresenter.GetRecordsInView(true);

 

Ok, so the problem begins....

1. This code must return for the grid to actually become grouped.

2. How do I expand one of the grouped items after the collection has been grouped?

3. There is no such event as after grouping so there is nothing to act on.

4. I am performing this from the Display CTs button.

Attached is a view of my grouped collection. I want to expand the "CT" items by the same label after the records have been grouped - without user interaction.

 

Thanks,

Glenn Long