Category / Section
What are the possible ways to refresh a range of cells in WinForms GridGroupingControl?
2 mins read
Ways to refresh range of cells
In order to refresh a range of cells, the following ways can be used,
1. SourceListListChanged event
2. Reload
method
Using SourceListListChanged event
The range of cells in a grid can be refreshed by setting TableDirty property value as true. When a table is marked dirty, any subsequent access to child elements and the resulting Syncfusion.Grouping.Element.EnsureInitialized(System.Object) call triggers re-categorization of all records in the table.
C#
this.gridGroupingControl1.SourceListListChanged += gridGroupingControl1_SourceListListChanged;
void gridGroupingControl1_SourceListListChanged(object sender, Syncfusion.Grouping.TableListChangedEventArgs e)
{
if (e.ListChangedType == ListChangedType.PropertyDescriptorChanged || e.ListChangedType == ListChangedType.ItemChanged)
e.Table.TableDirty = true;
}
VB
AddHandler Me.gridGroupingControl1.SourceListListChanged, AddressOf gridGroupingControl1_SourceListListChanged
Private Sub gridGroupingControl1_SourceListListChanged(ByVal sender As Object, ByVal e As Syncfusion.Grouping.TableListChangedEventArgs)
If e.ListChangedType = ListChangedType.PropertyDescriptorChanged OrElse e.ListChangedType = ListChangedType.ItemChanged Then
e.Table.TableDirty = True
End If
End Sub
Using Reload method
The range of
cells can also be refreshed by using Table.Reload method.
C#
this.gridGroupingControl1.Table.Reload();
VB
Me.gridGroupingControl1.Table.Reload()