Hi Vivek,
Thanks for your interest in Syncfusion Products.
The GridControl is a cell oriented grid and not column oriented as GridDataBoundGrid, so the model is not aware of the column names in grid. For more information on the GridControl architecture, check the shipped documentation or the online documentation from the below link.
http://www2.syncfusion.com/library5/index.htmHere is one way you could do this with GridControl, please try the below code.
private int NameToColIndex(string name)
{
int colIndex = -1;
for( int col = 1; col <= this.gridControl1.Model.ColCount; col++ )
{
if( this.gridControl1[0, col].Text == name )
{
colIndex = col;
break;
}
}
return colIndex;
}
Please refer to the forum thread below for more details.
http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=11801Let me know if you have any other questions.
Have a nice time.
Regards,
Rajagopal