AD
Administrator
Syncfusion Team
September 11, 2006 09:48 AM UTC
Hi Lim,
Try this code snippet to get the first column value in a record.
private void TableControl_MouseDown(object sender, MouseEventArgs e)
{
GridTableControl tableControl = sender as GridTableControl;
Point pt = new Point(e.X, e.Y);
int row, col;
if(tableControl.PointToRowCol(pt, out row, out col))
{
GridTableCellStyleInfo style = tableControl.PointToTableCellStyle(pt);
if( style.TableCellIdentity.DisplayElement.Kind == DisplayElementKind.Record)
{
GridRecordRow rec = style.TableCellIdentity.DisplayElement as GridRecordRow;
string firstColumnName = style.TableCellIdentity.Table.TableDescriptor.Columns[0].Name;
Console.WriteLine("First Column Value: " + rec.ParentRecord.GetValue(firstColumnName).ToString() );
}
}
}
Let me know if this helps.
Best Regards,
Haneef