I am using Infragistics 2009 vol 1.
My UltraGrid is bound to the BindingList of business objects "A", which themselves have the BindingList property for business objects "B". This leads to the presence of two ranges: one of them is called "BindingList`1", the other - "ListOfB" thanks to the currency manager.
I would like to update GroupBy grid sorting whenever changes are made to a child group through a child business object and INotifyPropertyChange.
If I group a property in a child group that is logical (say, "Active"), and I subscribe to the ListChanged event on the data source of the binding list with this event handler:
void Grid_ListChanged(object sender, ListChangedEventArgs e)
{
if (e.ListChangedType == ListChangedType.ItemChanged)
{
string columnKey = e.PropertyDescriptor.Name;
if (e.PropertyDescriptor.PropertyType.Name == "BindingList`1")
{
ultraGrid.DisplayLayout.Bands[columnKey].SortedColumns.RefreshSort(true);
}
else
{
UltraGridBand band = ultraGrid.DisplayLayout.Bands[0];
UltraGridColumn gc = band.Columns[columnKey];
if (gc.IsGroupByColumn || gc.SortIndicator != SortIndicator.None)
{
band.SortedColumns.RefreshSort(true);
}
ColumnFilter cf = band.ColumnFilters[columnKey];
if (cf.FilterConditions.Count > 0)
{
ultraGrid.DisplayLayout.RefreshFilters();
}
}
}
}
.SortedColumns.RefreshSort(true), groupby, Active :
, :
To:
( , )
: False (1 )
Active: True (2 )
- ?
RefreshSort (true);