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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Store an object in a column for faster data access

Thread ID:





50008 Oct 3,2006 01:26 PM UTC Oct 5,2006 08:51 AM UTC WinForms 3
Tags: GridControl
Shawn Neidig
Asked On October 3, 2006 01:26 PM UTC


I have implemented a virtual grid which is hooked up to an external data source. Inside GridQueryCellInfo I am currently using the row & column index to obtain each cell’s data. Instead of using the indexes, I want to store and Object in each column. The Object would be a pointer to a column in my data source. Then in GridQueryCellInfo, I could cast the Object & ask it directly for its cell value at e.RowIndex. Is there a property or way that I can store an Object that is associated with a single column?


Administrator [Syncfusion]
Replied On October 4, 2006 06:42 AM UTC

Hi Shawn,

You can directly access/store the GridData object instead of using an indexer on the grid. This will avoid events and probably be a factor of 5 - 10 times faster. Please refer the below thread for more details.


Another technique that quickly populate things and avoids the events that slow down using an indexer is to use SetCellInfo, passing true and false for the last two arguments.

/// Changes the cell contents at a specific row and column index and allows you to suppress raising events
/// and also avoid copying the style objects.
/// The row index.
/// The column index.
/// The object that holds cell information.
/// A that specifies the style operation to be performed.
/// A that indicates if the operation was successful.
/// If True, the method will not raise the event.
/// If True, the method will try to assign the style object directly. This is only possible if the
/// existing cell was empty before or if modifyType is . Otherwise it will apply the object as
/// specified in modifyType.
public bool SetCellInfo(int rowIndex, int colIndex, GridStyleInfo style, StyleModifyType modifyType, bool dontRaiseSaveCellInfoEvent, bool copyReferenceOnly)

And also you can use the SetCells method to update the range of cells in a grid.


Shawn Neidig
Replied On October 4, 2006 01:24 PM UTC


I think the "faster data access" portion of the subject was misleading. A better explanation of my problem is: I need to store a C# Object in each column of my virtual grid.

Each time a column is added to my external data source I get notified & provided two pieces of information column added index & a C# Object to that column. At this point, I want to store that Object in my grid for the specific column index.


Administrator [Syncfusion]
Replied On October 5, 2006 08:51 AM UTC

Hi Shawn,

You can use the Hashtable/ArrayList to store the column information in the virtual grid.

Hashtable hash= new Hashtable();
hash.Add(e.ColIndex) = Csharpobject;



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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

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