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

GridGroupingControl: ColumnIndex

Thread ID:

Created:

Updated:

Platform:

Replies:

49067 Sep 11,2006 09:00 AM UTC Sep 11,2006 12:26 PM UTC WinForms 2
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On September 11, 2006 09:00 AM UTC

hi,

i would like to get the cell value when i click on a certain row. i do as follow:

void TableControl_MouseDown(object sender, MouseEventArgs e)
{
int rowIndex, colIndex
Point pt = new Point(e.X, e.Y);
dgSent.TableControl.PointToRowCol(pt, out rowIndex, out colIndex);
dgSent.TableControl.Model[rowIndex,1].Text.Trim()
}

As the code above, i want to get the First Column value of the row. I failed to get it when there is GroupColumn.

Please help! Thanks!

Administrator [Syncfusion]
Replied On 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

Administrator [Syncfusion]
Replied On September 11, 2006 12:26 PM UTC

Thanks!! It''s help!

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

;