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.

Column name from column index GGC

Thread ID:

Created:

Updated:

Platform:

Replies:

55285 Jan 26,2007 08:43 AM Jan 28,2007 12:17 PM Windows Forms 1
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On January 26, 2007 08:43 AM

How can I get the column name of the current column index in a GGC?

Best regards,
Andi

Jayakumar Natarajan [Syncfusion]
Replied On January 28, 2007 12:17 PM

Hi Andi,
If you have access to CurrentCell, please use this code:


GridCurrentCell cc = Grid.TableControl.CurrentCell;

GridTableCellStyleInfo style = Grid.TableControl.Model[cc.RowIndex, cc.ColIndex] as GridTableCellStyleInfo;
if(style != null)
{
Console.WriteLine("column: {0}", style.TableCellIdentity.Column.Name);
}


With a column index,


int fieldIndex = Grid.TableControl.TableDescriptor.ColIndexToField(colIndex);
Console.WriteLine(Grid.TableDescriptor.Columns[fieldIndex].Name);


Regards,
Jay

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.

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.

;