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

GC: Refer to Column by name rather than index

Thread ID:





63850 Jul 10,2007 08:33 PM UTC Jul 12,2007 09:23 PM UTC WinForms 3
Tags: GridControl
Richard Bysouth
Asked On July 10, 2007 08:33 PM UTC


In the GridControl, is there a way to refer to a Column by name rather than index? This was a useful feature in the grid control I'm migrating from and meant I didn't have to use "magic numbers" when populating cells.
For example:
I would set a name property (or something similar) on each column in the grid - say "FirstName", "LastName"
Then, when populating the grid I would be able to use something like:
GridControl1(rowIndex, "FirstName").Text = "Richard"
GridControl1(rowIndex, "LastName").Text = "Smith"

Similarly, I would be able to refer to ColStyles using name or index:
GridControl1.ColStyles("FirstName").BackColor = Color.Red



haneefm [Syncfusion]
Replied On July 10, 2007 10:06 PM UTC

Hi Richard,

There is no built-in support for this. But you can map column index from its column name in a grid. Below is a forum thread that discuss with similar issue.


Best regards,

Richard Bysouth
Replied On July 12, 2007 02:38 AM UTC


That's ok for getting the alpha name from the index, but not the other way round

GetAlphaLabel(1) would return "A"

I really need GetColIndex("A"). I suppose this isn't available in the GridControl because data is copied into the grid rather than remaining bound to the datasource?

haneefm [Syncfusion]
Replied On July 12, 2007 09:23 PM UTC

Hi Richard,

Here is a forum thread that discuss with similar issue.

Best regards,


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

This page will automatically be redirected to the 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