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

checkBox in Grid event handler

Thread ID:





62032 Jun 6,2007 06:03 PM UTC Jun 6,2007 08:25 PM UTC WinForms 2
Tags: GridControl
Asked On June 6, 2007 06:03 PM UTC

I have checkboxes in a gridgroupingcontrol.

I hook into the TableControlCheckBoxClick event.

within this event, I capture the checked state of the checkbox and update the backend server with the new state, now if the server update fails, i want to revert the checkbox to its original checkstate before returning from this event, how do i go about this.

haneefm [Syncfusion]
Replied On June 6, 2007 06:33 PM UTC

Hi Nedu,

The TableControlCheckBoxClick is the event that gets triggered only when user clicks using the mouse on the checker box of checkbox cell. You can catch the TableControlCurrentCellChanged event for detecting any changes made to the checkbox cell. If the update fails, then you can set cell value using the CurrentRecord.SetValue method in a grid. Below is a code snippet

void grid_TableControlCurrentCellChanged(object sender, EventArgs e)
GridCurrentCell cc = e.TableControl.CurrentCell;
if (cc.Renderer.StyleInfo.CellType == "CheckBox")
Console.WriteLine("CheckBox cell( {0},{1})=> {2}", cc.RowIndex, cc.ColIndex, e.TableControl.GetTableViewStyleInfo(cc.RowIndex,cc.ColIndex).CellValue );
if( updateFails )

Best regards,

Replied On June 6, 2007 08:25 PM UTC

Thanks Haneef,

How do I get the original checkstate of the checkbox, if the server update fails, I want to stop the change from going thru.

For instance, lets say the checkbox has a value of [True or Checked], a user clicks on it to change it to [False or UnChecked], I capture that click event and update the server with the new value, which would be [False or UnChecked] now and all is fine

However, if the update to the server fails, I want to keep the original value of the checkbox which is [True or Checked] in this case...


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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