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. Image for the cookie policy date
close icon

Grouping Control

I have some code in the RecordValueChanged event handler wherein if somebody changes a cell value - it caculates the values for other cells in that grid row.
This happens when the user enters a value in the cell and hits enter. I now want to do the same thing where the user enters a value in the cell and instead of hitting enter - clicks on apply button on that form to save the changes.
Any help is appreciated.
Also, is there a way to trap the Shift+Tab key combination in the TableControlCurrentCellKeyDown event handler?

Thanks,


1 Reply

AD Administrator Syncfusion Team December 14, 2007 09:58 AM UTC

Normally, pressing a button will cause validation to occur on the previously focussed control. But if the button is on a toolbar or if the button has its CausesValidation property set false, then the validation of the previous control does not occur, and that control does not know to save it pending changes. One way around this problem is to add a call to

this.Validate();

at the beginning of your Apply button code. Here, 'this' refers to the Form holding the grid. This should work for any previous control, not just the GridGroupingControl.

If you do not want to force the validation using this.Validate(), then you could just try telling the grid to save its changes at the top of the Apply button code.

if (this.gridGroupingControl1.Table.CurrentRecord != null
&& this.gridGroupingControl1.Table.CurrentRecord.IsEditing)
{
this.gridGroupingControl1.Table.CurrentRecord.EndEdit();
}

Try using this code to catch shift+Tab.

void gridGroupingControl1_TableControlCurrentCellKeyDown(object sender, GridTableControlKeyEventArgs e)
{
if (e.Inner.Shift && e.Inner.KeyCode == Keys.Tab)
this.Text = "Shift+Tab";
}





Loader.
Live Chat Icon For mobile
Up arrow icon