Accessing cell content (value) in TableControlCheckBoxClick event
Hi,
I have an unbound column of checkboxes in GGC. In the above Event I'm trying to access the contents of the cell (to evaluate whether the check box has just been checked or unchecked) and the record's Primary key field (so i can update the underlying Hash table).
How do I do this? Sounds like it should be obvious but it isn't.
N.B. The reason i am having to do this in the click event is because the unboundField_SaveValue event does not fire until after the cell has lost focus. So, in my example, if the user clicks on one check box and I want to react to that by e.g. enabling a button somewhere then they have to click somewhere else omn the grid before the SaveValue event will fire. Maybe there is a better workaround?
I have an unbound column of checkboxes in GGC. In the above Event I'm trying to access the contents of the cell (to evaluate whether the check box has just been checked or unchecked) and the record's Primary key field (so i can update the underlying Hash table).
How do I do this? Sounds like it should be obvious but it isn't.
N.B. The reason i am having to do this in the click event is because the unboundField_SaveValue event does not fire until after the cell has lost focus. So, in my example, if the user clicks on one check box and I want to react to that by e.g. enabling a button somewhere then they have to click somewhere else omn the grid before the SaveValue event will fire. Maybe there is a better workaround?
SIGN IN To post a reply.
5 Replies
HA
haneefm
Syncfusion Team
July 6, 2007 03:32 PM UTC
Hi Paul,
Below is a KB article that shows you "How do I have an unbound checkbox column in a GridGroupingControl?".
http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=293
Best regards,
Haneef
Below is a KB article that shows you "How do I have an unbound checkbox column in a GridGroupingControl?".
http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=293
Best regards,
Haneef
PS
Paul Sullivan
July 6, 2007 08:35 PM UTC
Haneef,
I have already implemented the check box column. Specifically the problem is with the SaveValue event not firing until the cell loses focus, rather than when the celvalue changes. Is there a workaround for that e.g. forcing the loss of focus on the cell?
I have already implemented the check box column. Specifically the problem is with the SaveValue event not firing until the cell loses focus, rather than when the celvalue changes. Is there a workaround for that e.g. forcing the loss of focus on the cell?
HA
haneefm
Syncfusion Team
July 6, 2007 09:30 PM UTC
Hi Paul,
Try calling the RaiseSaveValue method to fire the SaveValue event in a grid.Below are the code snippet
private void gridGroupingControl1_TableControlCheckBoxClick(object sender, GridTableControlCellClickEventArgs e)
{
Record rec = e.TableControl.Table.CurrentRecord;
FieldValueEventArgs fArg = new FieldValueEventArgs(e.TableControl.TableDescriptor.Fields["print"],rec,false);
e.TableControl.TableDescriptor.RaiseSaveValue(fArg);
}
Best regards,
Haneef
Try calling the RaiseSaveValue method to fire the SaveValue event in a grid.Below are the code snippet
private void gridGroupingControl1_TableControlCheckBoxClick(object sender, GridTableControlCellClickEventArgs e)
{
Record rec = e.TableControl.Table.CurrentRecord;
FieldValueEventArgs fArg = new FieldValueEventArgs(e.TableControl.TableDescriptor.Fields["print"],rec,false);
e.TableControl.TableDescriptor.RaiseSaveValue(fArg);
}
Best regards,
Haneef
TR
Thulasi Ram Lingalugari
April 26, 2012 08:23 PM UTC
Hi, we are facing an issue on firing button click event after cell edit. we are displaying a message eg: Message1, on cell lost focus event and there is a BUTTON outside grid and on click of this, another message will be displayed eg: Message2. Now if user edits the value in a cell and click on the BUTTON directly outside the grid, first cell lost focus event fires and so is displays Message1, but it is not firing BUTTON click event. After finishing cell focus event functionality, focus is on the BUTTON, but BUTTON click event is not firing. we have tried putting Grid.currentcell.endedit(); in button click event, still no luck. please let us know if there is any fix/workaround for this.
thanks,
Ram
thanks,
Ram
RB
Ragamathulla B
Syncfusion Team
May 10, 2012 09:48 AM UTC
Hi Ram,
Thank you for your interest in syncfusion products,
You can resolve this issue manually by using GotFocus event. Pleaser refer the following code.
bool butval = false; void button1_GotFocus(object sender, EventArgs e){
ButtonBase but = sender as ButtonBase; if ((but != null) && ! butval){
button1.PerformClick();
butval =
true;}
}
Please refer to the following attached sample which illustrates the same.
Let me know if you have any further concerns.
Regards,
Ragamathullah B.
CS_ad9fef9a.zip
SIGN IN To post a reply.
- 5 Replies
- 4 Participants
-
PS Paul Sullivan
- Jul 6, 2007 10:44 AM UTC
- May 10, 2012 09:48 AM UTC