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.

Checkbox in cell click is not returning correct state

Thread ID:

Created:

Updated:

Platform:

Replies:

69010 Oct 9,2007 03:14 PM Oct 10,2007 10:52 AM Windows Forms 1
loading
Tags: GridControl
Ashes Mukherjee
Asked On October 9, 2007 03:14 PM

I am handling the GridCellClickEventHandler. While debugging, I noticed this event fires before the checkbox click takes effect, for e.g. if the original state was checked, the state value when stepping into this function is still true, although, the click would have set the value to false.

Am I supposed to reverse this logic or is there a better way of doing this?

Thanks

haneefm [Syncfusion]
Replied On October 10, 2007 10:52 AM

Hi Ashes,

The reason is that the CheckBoxClick is raised just before the value of the current cell is changed. Try handling the CurrentCellChanged event. This is raised after the value has been updated. In the CurrentCellChanged event, you can access the underlying style value with grid.Model[CurrentCell.RowIndex, CurrentCell.ColIndex].CellValue.Here is code snippet

private void grid_CurrentCellChanged(object sender, EventArgs e)
{
GridCurrentCell cc = this.grid.CurrentCell;
GridStyleInfo style = this.grid.Model[cc.RowIndex, cc.ColIndex];
if(style.CellType == "CheckBox")
{
Console.WriteLine(style.CellValue);
}
}

Best regards,
Haneef

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.

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.

;