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.
Syncfusion Feedback

GC: Refer to Column by name rather than index

Thread ID:

Created:

Updated:

Platform:

Replies:

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

Hi

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

thanks

Richard

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.

http://www.syncfusion.com/support/Forums/message.aspx?&MessageID=61803

Best regards,
Haneef

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

Hi

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.
http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=11801

Best regards,
Haneef

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

;