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.

ctrl-S to save values inside the GridGroupingControl

Thread ID:

Created:

Updated:

Platform:

Replies:

106549 Jan 14,2013 12:30 PM Jan 25,2013 01:24 AM Windows Forms 3
loading
Tags: Grouping
Gaukhar Massabayeva
Asked On January 14, 2013 12:30 PM

Hi

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

Thank you


Athiram S [Syncfusion]
Replied On January 17, 2013 08:57 PM

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


Gaukhar Massabayeva
Replied On January 22, 2013 10:49 AM

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

Rajadurai C [Syncfusion]
Replied On January 25, 2013 01:24 AM

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


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.

;