This is a migrated thread and some comments may be shown as answers.

Find & Collapse Specific Group based on FieldName

1 Answer 76 Views
Grid
This is a migrated thread and some comments may be shown as answers.
AJ
Top achievements
Rank 2
AJ asked on 20 Feb 2012, 08:22 PM
Is it possible to collapse (or expand) a group based on the Group's FieldName property?

I have the following in my PreRender function, but it just collapses all groups:

foreach (var gi in rgVendorInvItems.MasterTableView.GetItems(GridItemType.GroupHeader))
{
     gi.SetChildrenVisible(false);
}

Any input would be greatly appreciated!

1 Answer, 1 is accepted

Sort by
0
AJ
Top achievements
Rank 2
answered on 20 Feb 2012, 08:29 PM
Alright, so it figures as soon as I ask the next page I go to has a good example, based on the Data Cell's text


foreach (var item in rgVendorInvItems.MasterTableView.GetItems(GridItemType.GroupHeader))
            {
                if (((GridGroupHeaderItem)(item)).DataCell.Text.Contains("33-1575"))
                    item.Expanded = true;
                else
                    item.Expanded = false;
            }
Tags
Grid
Asked by
AJ
Top achievements
Rank 2
Answers by
AJ
Top achievements
Rank 2
Share this question
or