We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Virtual Grid question

Hi After developing a project with the virtual grid it appears that most of the features offered by the grid (like the filter bar, the sorting...) has to be completely reimplemented. How different is the virtual mode so that we must use it. Is the normal grid suitable for real-time data ? Thanks Silver

14 Replies

AD Administrator Syncfusion Team February 3, 2005 04:15 PM UTC

Hi Silver, the normal grid does not have any support for filter bar, sorting. The GridDataBoundGrid and the GridGroupingControl support these feature out of the box. Performance-wise you have the following options: - Use regular grid with custom volatile data case (as shown in Performance/RefreshGrid example or OneTimeQueryCellInfo). This gives highest performance for realtime data but also most difficult to implement. - Use GridDataBoundGrid and listen to ListChanged event. This gives almost same performance as virtual grid and is much easier to implement. You only need to fire appropriate ListChange events from your data source. It has no support for grouping and support for nested relations is limited. - Use virtual grid. Performance is like GridDataBoundGrid but more coding is necessary. It has no support for grouping and support for nested relations is limited. - GridGroupingControl. This gives full support for grouping and nested relations but real-time data will be a bit slower than for other grids. You really need to optimize it and handle certain events (e.g. SourceListListChanged event, InvalidateAllWhenListChange property etc.) depending on exactly what you need to get best performance. Stefan


AD Administrator Syncfusion Team February 4, 2005 03:24 PM UTC

Thanks but i don(t see the listchange event... Silver >Hi Silver, > >the normal grid does not have any support for filter bar, sorting. The GridDataBoundGrid and the GridGroupingControl support these feature out of the box. > >Performance-wise you have the following options: > >- Use regular grid with custom volatile data case (as shown in Performance/RefreshGrid example or OneTimeQueryCellInfo). This gives highest performance for realtime data but also most difficult to implement. > >- Use GridDataBoundGrid and listen to ListChanged event. This gives almost same performance as virtual grid and is much easier to implement. You only need to fire appropriate ListChange events from your data source. It has no support for grouping and support for nested relations is limited. > >- Use virtual grid. Performance is like GridDataBoundGrid but more coding is necessary. It has no support for grouping and support for nested relations is limited. > >- GridGroupingControl. This gives full support for grouping and nested relations but real-time data will be a bit slower than for other grids. You really need to optimize it and handle certain events (e.g. SourceListListChanged event, InvalidateAllWhenListChange property etc.) depending on exactly what you need to get best performance. > >Stefan > >


AD Administrator Syncfusion Team February 4, 2005 09:38 PM UTC

ListChanged is an event that is raised by a datasource that implements IBindingList. For example, a DataView implements IBindingList. See the CustomerCollection in Windows\Grid.Windows\Samples\Grouping\StrongTypedCollection for a custom implementation of IBindingList Stefan > >Thanks but i don(t see the listchange event... > >Silver >>Hi Silver, >> >>the normal grid does not have any support for filter bar, sorting. The GridDataBoundGrid and the GridGroupingControl support these feature out of the box. >> >>Performance-wise you have the following options: >> >>- Use regular grid with custom volatile data case (as shown in Performance/RefreshGrid example or OneTimeQueryCellInfo). This gives highest performance for realtime data but also most difficult to implement. >> >>- Use GridDataBoundGrid and listen to ListChanged event. This gives almost same performance as virtual grid and is much easier to implement. You only need to fire appropriate ListChange events from your data source. It has no support for grouping and support for nested relations is limited. >> >>- Use virtual grid. Performance is like GridDataBoundGrid but more coding is necessary. It has no support for grouping and support for nested relations is limited. >> >>- GridGroupingControl. This gives full support for grouping and nested relations but real-time data will be a bit slower than for other grids. You really need to optimize it and handle certain events (e.g. SourceListListChanged event, InvalidateAllWhenListChange property etc.) depending on exactly what you need to get best performance. >> >>Stefan >> >>


AD Administrator Syncfusion Team February 7, 2005 12:42 PM UTC

The listChange event is not implemented in a datatable. So if some data happen to change in this DataTable, i can''t control how often i want the grid to be notified.


AD Administrator Syncfusion Team February 7, 2005 01:13 PM UTC

If you using a DataTable dataTable1, try subscribing to datatable1.DefaultView.ListChanged. Or, create your own DataView on the dataTable1, and use that dataview to access the DataTable.


AD Administrator Syncfusion Team February 7, 2005 01:19 PM UTC

Thanks Clay but now i don''t understand what can i do whith that. Basically the event is triggered when new data comes in. Then how do i wire it whith the grid ?


AD Administrator Syncfusion Team February 7, 2005 01:31 PM UTC

You can check ListChangedType.ItemChanged and there you can call grid.RefreshRange(GridRangeInfo.Row(e.NewIndex + 1), true); to trigger a QueryCellInfo that will display the new data in the virtual grid. If you do not want to redraw the whole row to refresh the grid any time the datasource changes, then you can handle the datatable.ColumnChanged event adn remember the column in a variable. Then in listChnaged, instead of doing a row range, you can do a cell range using that saved column.


AD Administrator Syncfusion Team February 7, 2005 06:12 PM UTC

Is this compatible with a DBGrid ? I''m not using a virtualGrid but a DBGrid. Actually how (which event) the grid knows a data has been changed in the datasource ? If QueryCellInfo is usabel in the DBGrid so i don''t see how different it is from the virtual one ? >You can check ListChangedType.ItemChanged and there you can call grid.RefreshRange(GridRangeInfo.Row(e.NewIndex + 1), true); to trigger a QueryCellInfo that will display the new data in the virtual grid. > >If you do not want to redraw the whole row to refresh the grid any time the datasource changes, then you can handle the datatable.ColumnChanged event adn remember the column in a variable. Then in listChnaged, instead of doing a row range, you can do a cell range using that saved column.


AD Administrator Syncfusion Team February 7, 2005 07:12 PM UTC

If you are using a DataTable, and do not want to do anything special when something outside the grid updates the datatable, then you do not have to do anything as the grid will handle this for you. It does it by listening to the ListChanged event associated with the datasource. >>If QueryCellInfo is usabel in the DBGrid so i don''''t see how different it is from the virtual one ? The GridDataBoundGrid is a type of virtual grid. The DataSource provides the virtual data and the derived grid class gets at the data when it needs it in a ''virtual type'' handler.


AD Administrator Syncfusion Team February 8, 2005 01:35 PM UTC

Clay The QueryCellInfo event is not implemented in the DBGrid .... What did you meand then when you said : " there you can call grid.RefreshRange(GridRangeInfo.Row(e.NewIndex + 1), true); to trigger a QueryCellInfo that will display the new data in the virtual grid. "


AD Administrator Syncfusion Team February 8, 2005 04:39 PM UTC

Hi Silver, in your ListChanged event handler you can check for the e.ListChangedType = ListChangedType.ItemChanged. For ListChangedType.ItemChanged you can then call grid.RefreshRange(GridRangeInfo.Row(e.NewIndex + 1), true); Once you call RefreshRange the row will be repainted and QueryCellInfo will get called to retrieve the current data to be displayed in that row. Stefan >Clay > >The QueryCellInfo event is not implemented in the DBGrid .... > >What did you meand then when you said : >" there you can call grid.RefreshRange(GridRangeInfo.Row(e.NewIndex + 1), true); to trigger a QueryCellInfo that will display the new data in the virtual grid. " >


AD Administrator Syncfusion Team February 8, 2005 04:42 PM UTC

Its grid.Model.QueryCellInfo in a GridDataBoundGrid.


AD Administrator Syncfusion Team February 8, 2005 06:57 PM UTC

How can i subscribe for this event in the DBGrid ?


AD Administrator Syncfusion Team February 8, 2005 09:03 PM UTC

You need to do it like this: this.gridDataBoundGrid1.Model.QueryCellInfo += new GridQueryCellInfoEventHandler(Model_QueryCellInfo); Stefan >How can i subscribe for this event in the DBGrid ?

Loader.
Live Chat Icon For mobile
Up arrow icon