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

Column name from column index GGC

Thread ID:

Created:

Updated:

Platform:

Replies:

55285 Jan 26,2007 01:43 PM UTC Jan 28,2007 05:17 PM UTC WinForms 1
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On January 26, 2007 01:43 PM UTC

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 05:17 PM UTC

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.

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

;