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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

how to get correct cell value from gridgroupcontrol?

Thread ID:

Created:

Updated:

Platform:

Replies:

47479 Aug 4,2006 08:46 PM UTC Aug 7,2006 05:15 AM UTC WinForms 1
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On August 4, 2006 08:46 PM UTC

Hi,

I have a gridgroupcontrol with datatable as datasource.
I tried to get the cell value from col2 when I right click the row (from contextmenu).
I tried to directly get the data from datatable,but it does not work after the sorting. Then I tried to get the cell value based on the kep and then find the row the datatable. The problem is that I cannot find the method under groupctrol to get the corresponding cellvalue for the row i clicked (as I did in normal datagrid)?

Is there a (better) way to do it?

Thanks

Chrisben

Administrator [Syncfusion]
Replied On August 7, 2006 05:15 AM UTC

Hi Chris,

Please try the code below in the TableControlCellClick event of the grid.

if(e.Inner.MouseEventArgs.Button == MouseButtons.Right)
{
GridCurrentCell cc = e.TableControl.CurrentCell;
Console.WriteLine("newValue: {0} oldvalue: {1}", cc.Renderer.ControlText, e.TableControl.Model[cc.RowIndex, cc.ColIndex].CellValue);
GridTableCellStyleInfo style = e.TableControl.Model[cc.RowIndex, cc.ColIndex] as GridTableCellStyleInfo;
if(style != null)
{
Console.WriteLine("columnName: {0}", style.TableCellIdentity.Column.Name);
}
}

Let us know if you have any other questions.
Regards,
Rajagopal

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

;