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.

Grouping Control

Thread ID:

Created:

Updated:

Platform:

Replies:

70509 Dec 13,2007 02:19 PM Dec 14,2007 04:58 AM Windows Forms 1
loading
Tags: Grouping
Prem
Asked On December 13, 2007 02:19 PM

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,


Administrator [Syncfusion]
Replied On December 14, 2007 04:58 AM

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";
}





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.

;