This sample illustrates filling a GDBG, virtual grid, and a Windows Forms data grid with a specified number of records as well as toggling the various options that can affect the speed of the grid.
You can choose either a Grid data-bound grid or a virtual grid or a Windows Forms Data Grid in the sample to see the performance.
GDBG
Features
Initialize Table
Initialize the grid by specifying the number of records at the top-right corner of the sample. By checking the check boxes provided, you can use OptimizedListChangeEvent, set "ResizeToFit" option for ColWidths and DataTableList.
OptimizedListChangeEvent specifies whether to listen to IBindingList.ListChanged, instead of the currency manager change events, in order to update the grid while ResizeToFit on ColWidths specifies whether the column widths should be resized to fit the cell's content when it loads.
DataTableList specifies whether to use Syncfusion.Collections.DataTableWrapperList instead of the data table as the data source.
DataTableWrapperList is an IBindingList collection that wraps a data table and provides optimized access to the rows of the data table
Using this as the grid’s data source will improve performance when inserting records into an existing table that has many records.
Manipulate Grid
In the Manipulate Grid options, you can specify the repeat count and the batch size in order to check the performance in batch updates.
You can also enable the scroll window check box, which invalidates only the inserted or removed rows instead of invalidating the whole grid.
The Insert and Remove operation lets you check performance when inserting, removing, or changing the records in the underlying data table.
Once data is loaded after the batch update, you will be able to see the performance and the memory usage in the text box as shown below:
The above applies to a virtual grid also.
As Virtual Grid is not a bound control, it will not listen to ListChangedEvent to update the grid.
Once the records are inserted or removed, calling Grid.Refresh will fire the QueryCellInfo to update the grid from the data table.
You
can observe the performance in the Windows Forms of the data grid
with respect to GridDataBoundGrid/Virtual.