Column name from column index GGC

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

Best regards,
Andi

1 Reply

JN Jayakumar Natarajan Syncfusion Team 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

Loader.
Up arrow icon