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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Grid Binding

Thread ID:

Created:

Updated:

Platform:

Replies:

29878 Jun 6,2005 10:23 AM UTC Jun 6,2005 02:06 PM UTC WinForms 2
loading
Tags: GridControl
Lokesh Luthra
Asked On June 6, 2005 10:23 AM UTC

Hi I am filling a grid by looping through the Datatable and inserting a new row in the grid.Thr grid adds rows equaivalent to the number of rows in the Datatable . 2. Second thing i do on the grid is I add the headers in between the grid rows. Lets say I have 50 rows . based on some field in the datatable which gets changed I insert a new row in the grid of type Header . Which actually displays that the rows below the grid belongs to some particular category.I hope i Am clear till this point. 3. There is a column in the Datatable Say GOAL and the same column is there in the grid. Now I change the values in the GOAL Column of the grid. On the Grids Editing Complete I update the datatable and uses some private functions on the datatable to calculate the values which actually affected other rows GOAL columns.Functions work well but the Grid is not Updated Actually.Clear till this point !! 4. So to update the Grid I loop through the datatable and based on a primary field in the Datatable I search the record in the grid again looping through the grid and When i find the matched value I update the GOAL value in the grid.but this is so time consuming it takes around 2 minutes. I want to know can i bind the grid GOAL column to the Datatable Column after the screen is loaded so that my grid values should be updated automatically as soon as I am changing the values in the grid Keepng in mind that I have some rows in the Grid which are headers only and are of display porpose.

Administrator [Syncfusion]
Replied On June 6, 2005 11:35 AM UTC

You did not say what kind of grid you were using, so I assume it is a GridControl. One possible way to speed things up is that after the grid has be populated the way you want it, you loop through the grid one time, creating a hashtable whose keys are the primary-key value for the row in the grid and whose value is the rowindex of the row in the grid. (ie, create a hashtable that maps primary key values to grid row indexes.) Then in step 3, when you call you private functions to change particular values directly in your datatable, you can use this hashtable to look up the proper row that you need to update, and not have to search for it.

Lokesh Luthra
Replied On June 6, 2005 02:06 PM UTC

Hi Clay HATS OFF ...Time has drastically reduced to 4 seconds from 2 minutes .Thanx n Cheers >You did not say what kind of grid you were using, so I assume it is a GridControl. > >One possible way to speed things up is that after the grid has be populated the way you want it, you loop through the grid one time, creating a hashtable whose keys are the primary-key value for the row in the grid and whose value is the rowindex of the row in the grid. (ie, create a hashtable that maps primary key values to grid row indexes.) Then in step 3, when you call you private functions to change particular values directly in your datatable, you can use this hashtable to look up the proper row that you need to update, and not have to search for it.

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.

Warning Icon 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.Close Icon

;