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

How to convert ColIndex into a column name for a GridControl?

Thread ID:





57464 Mar 5,2007 03:39 PM UTC Mar 6,2007 11:12 AM UTC WinForms 4
Tags: GridControl
John H
Asked On March 5, 2007 03:39 PM UTC

I have asked this question before for the GGC, but now I need to do it for a GridControl within the PrepareViewStyleInfo event. Do you have any examples? I cant find a TableDescriptor for the GridControl.


Administrator [Syncfusion]
Replied On March 5, 2007 03:57 PM UTC

Actually to be more specific, how do I convert the RowIndex and ColIndex within the PrepareViewStyleInfo event of a GridControl to the actual row and column indexes of the underlying dataset?


Administrator [Syncfusion]
Replied On March 5, 2007 04:05 PM UTC

Hi John,

For GridControl:

Call the GetAlphaLabel method to get the column labels in a grid. Here is a code snippet

string strColumnName = GridRangeInfo.GetAlphaLabel(e.ColIndex);

For DataBoundGrid:

Use InternalColumn collection property to get the column name of the grid. Below is a code

string strColumnName = this.gridDataBoundGrid1.Binder.InternalColumns[e.ColIndex].MappingName;

Best Regards,

John H
Replied On March 6, 2007 11:04 AM UTC

Hi Haneef,

Sorry Im not sure how this works:

Is GridRangeInfo a property of the grid? do I need to get the current selection and create a GridRangeInfo for it?
Sorry I think Im being a bit dim today.


John H
Replied On March 6, 2007 11:12 AM UTC

Hi Haneef,
I found an example, its quite obvious really. :-)


Basically just use;
gridControl[0, e.ColIndex].Text;



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