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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Event on cell editor and Force Data Binding Refresh

Thread ID:





76091 Aug 21,2008 09:25 PM UTC Aug 26,2008 02:33 PM UTC WinForms 2
Tags: GridControl
Philippe Marseille
Asked On August 21, 2008 09:25 PM UTC

I have 2 problems with the GridDataBoundGrid.

1st : In my application, when I press the F7 key, I want to call a specific piece of code. So far, I've simply added the call to the key-Up event of all the controls. It works fine except when I'm editing a row in the grid. I suppose the grid creates a Textfield for me to type in and that field does not have the event. In Java, using a JTable, I was able to change the default "cell editor" to add the event. How can I do this in a GridDataBoundGrid?

2nd : When editing a cell, the changes are "commited" back to the data-source only when the focus exits the row. Is there a way to FORCE this update without exiting the row?? From Java again, there was a function called "grid.IsEditing" and "grid.EndEditing"... I'm looking for something similar. It's related to the F7 key too... When I hit F7, I want the DataSource to be updated and editing to end.


Philippe Marseille
Replied On August 22, 2008 01:22 PM UTC


I've found a solution for problem #1. grid.CurrentCell.IsEditing and grid.CurrentCell.EndEdit();

Still trying to catch a key_up event when editing a cell... the KeyPressed event on the current cell (CurrentCell_Key-Pressed) works ok for charaters but not for F7 keys, I need the KeyUp event...

Philippe Marseille
Replied On August 26, 2008 02:33 PM UTC

Finally found the solution by myself.

To catch events on the cell editor

GridTextBoxCellRenderer tbr = (GridTextBoxCellRenderer)grid.CellRenderers["TextBox"];

tbr.TextBox.KeyUp += new KeyEventHandler(Handler_KeyUp);

And finally, to force an update of the data (reverse of the refresh): grid.CommitChanges();


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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon 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.Close Icon