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. Image for the cookie policy date
close icon

How can I get CellValue

Hi,

I use GridTableControlCellClickEventHandler to listen a mouse click event on a GGC cell. I want to get a column index of a col name so I can use:

obj = this.groupingGridTrade.TableModel.Model[e.Inner.RowIndex, colIndex].CellValue;

How can I do it?

Thanks,
HB

1 Reply

JS Jeba S Syncfusion Team March 28, 2007 04:00 AM UTC

Hi HB,

You can get the column index of a column name using the TableDescriptor.NameToField.

private void gridGroupingControl1_TableControlCellClick(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlCellClickEventArgs e)
{
string colName=e.TableControl.GetTableViewStyleInfo(e.Inner.RowIndex, e.Inner.ColIndex).TableCellIdentity.Column.Name;
int colIndex=e.TableControl.TableDescriptor.NameToField(colName) ;
object s=e.TableControl.GetTableViewStyleInfo(e.Inner.RowIndex, colIndex).CellValue;
Console.WriteLine("CellValue="+s);
Console.WriteLine(e.TableControl.GetTableViewStyleInfo(e.Inner.RowIndex, e.Inner.ColIndex).Text);
}

Kindly let us know if this helps.

Best Regards,
Jeba.

Loader.
Live Chat Icon For mobile
Up arrow icon