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.
Unfortunately, activation email could not send to your email. Please try again.

Virtual Grid question

Thread ID:

Created:

Updated:

Platform:

Replies:

24412 Feb 3,2005 10:03 AM Feb 8,2005 04:03 PM Windows Forms 14
loading
Tags: GridControl
Silver
Asked On February 3, 2005 10:03 AM

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

Administrator [Syncfusion]
Replied On February 3, 2005 11:15 AM

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

Administrator [Syncfusion]
Replied On February 4, 2005 10:24 AM

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 > >

Administrator [Syncfusion]
Replied On February 4, 2005 04:38 PM

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 >> >>

Administrator [Syncfusion]
Replied On February 7, 2005 07:42 AM

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.

Administrator [Syncfusion]
Replied On February 7, 2005 08:13 AM

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.

Administrator [Syncfusion]
Replied On February 7, 2005 08:19 AM

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 ?

Administrator [Syncfusion]
Replied On February 7, 2005 08:31 AM

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.

Administrator [Syncfusion]
Replied On February 7, 2005 01:12 PM

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.

Administrator [Syncfusion]
Replied On February 7, 2005 02:12 PM

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.

Administrator [Syncfusion]
Replied On February 8, 2005 08:35 AM

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. "

Administrator [Syncfusion]
Replied On February 8, 2005 11:39 AM

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. " >

Administrator [Syncfusion]
Replied On February 8, 2005 11:42 AM

Its grid.Model.QueryCellInfo in a GridDataBoundGrid.

Administrator [Syncfusion]
Replied On February 8, 2005 01:57 PM

How can i subscribe for this event in the DBGrid ?

Administrator [Syncfusion]
Replied On February 8, 2005 04:03 PM

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 ?

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;