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

ctrl-S to save values inside the GridGroupingControl

Hi

I want to be able to use ctrl - S to save the values in the grid. Can this be achieved?

Thank you


3 Replies

AS Athiram S Syncfusion Team January 18, 2013 01:57 AM UTC

Hi Gaukar,

Thanks for your interest in syncfusion products.

You can make use of the following code in saving the content:

this.gridDataBoundGrid1.BeginUpdate();
if (gridDataBoundGrid1.CurrentCell.IsEditing) {
gridDataBoundGrid1.CurrentCell.EndEdit();
}
if (gridDataBoundGrid1.Binder.IsEditing) {
gridDataBoundGrid1.Binder.EndEdit();
}
this.gridDataBoundGrid1.EndUpdate();

Please let me know if you have any concerns.

Regards,

Athiram S



GM Gaukhar Massabayeva January 22, 2013 03:49 PM UTC

I was interested in more of a scenario where user presses ctrl - S and an EventHandler is called (I already have the EventHandler, just need a way of recognising that ctrl - S is pressed).
 
Thank you


RC Rajadurai C Syncfusion Team January 25, 2013 06:24 AM UTC

Hi Gaukhar,

Thanks for your update.

You can handle either of the following two events based on your requirement and check for the key pressed and call the event handler that you have from there.

this.gridGroupingControl1.KeyDown += new KeyEventHandler(gridGroupingControl1_KeyDown);

(or)

this.gridGroupingControl1.TableControlCurrentCellKeyDown += new Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlKeyEventHandler(gridGroupingControl1_TableControlCurrentCellKeyDown);

// gridGroupingControl1_TableControlCurrentCellKeyDown

void gridGroupingControl1_TableControlCurrentCellKeyDown(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlKeyEventArgs e)

{

    if(Control.ModifierKeys == Keys.Control && e.Inner.KeyCode == Keys.S)

    {

        // Code to call event handler for saving

    }

}

 

// gridGroupingControl1_KeyDown

void gridGroupingControl1_KeyDown(object sender, KeyEventArgs e)

{

    if (Control.ModifierKeys == Keys.Control && e.KeyCode == Keys.S)

    {

        //Call to event handler for saving

    }

}

 

Regards,

Rajadurai


Loader.
Live Chat Icon For mobile
Up arrow icon