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

DBGrid Performance

I have a DBGrid and a DataTable. The DataTable is updated in real time. I want the grid to update itself once every 200ms with the new updates for performance. I understand from the previous answers that once the grid is connected to the DataTable it is notified for every change and reflects it. So to slow down the pace of displayed data, i have to slow down the pace of the DataTable data. If i want to stack the new incomming data and notify the grid with only the changes it it not possible since it is connected to the DataTable (which is great for sorting and so on....) Can we reverse the model and tell the Grid to listen to the dataTable every 200ms and unwire ? Or is there a way to listen to updates only ? BeginLoadData

4 Replies

AD Administrator Syncfusion Team February 8, 2005 02:38 PM UTC

Also i tried to increase the pace of data and in bound mode the CPU grows up to 100 ! An worse it never decrease even when i stop the data flow ! Is this a memory leak of the grid since when i do the same without the grid my model handles it well ?


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

We know of no memory leaks using the GridDataBoundGrid with 3.0.1.0 (or 2.1.0.9). I suspect the processing is just taking that long. You can call grid.Binder.SuspendBinding to turn off the grid istening to updates, and the grid.Binder.ResumeBinding to turn the updates back on. You could try doing this in a timer.Tick event every so often to see if that will let things work for you. You could also use multiple threads, cacheing all the changes in a dataset on a different thread and then every so often call dataset.Merge to update the grid''s datasource with all the cache changes.


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

Clay What is exactly the "model" property in the grid ? IF it is the internal model for the grid then does it means : 1-It has the same size as the external model ? 2-The sorting and filtering occur in the internal model. 3-Where is the optization where the model should take just what it needs to display ? Otherwise why separate the model from the external source ? Thanks again for the time and the great support !!


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

Hi, 1. grid.Model is a reference to the GridModel object. The GridModel contains grid specific information that can be shared across views like row height, column widths, covered ranges and more. In addition the GridModel provides a temporary data cache that contains cell contents. The cell contents are determined by calls to QueryCellInfo. The cache is emptied when garbage collection occurs. With a GridDataBoundGrid an addition Model-like object is introduced, the Binder. The Binder provides specific implementations for QueryCellInfo, SaveCellInfo and managing synchronization with a CurrencyManager and extracting values from a IList (or DataView). 2. The soring and filtering does not occur in the grid. It occurs in the underlying IList (your DataView). The DataView prvoides methods for sorting and filtering data and all the grid does is display those results. 3. The model never keeps data for a long time. The volatile data cache gets emptied frequently and only those rows that are currently visible are loaded into memory using QueryCellInfo calls. At that time additional cell information like color, font, cell type is also determined. This all happens in the GridModel. Stefan >Clay > >What is exactly the "model" property in the grid ? > >IF it is the internal model for the grid then does it means : > >1-It has the same size as the external model ? >2-The sorting and filtering occur in the internal model. >3-Where is the optization where the model should take just what it needs to display ? Otherwise why separate the model from the external source ? > >Thanks again for the time and the great support !!

Loader.
Live Chat Icon For mobile
Up arrow icon