I databinded my entities to a gridview, but when i click my save button on my form (on toolbar), gridview don't post my changes in active editing cell. I have to change the active cell to submit changes to entity. I searched your support center and i found a solution: I created a class (myGridView) that inherits from GridView, and i overrided the OnActiveEditor_ValueChanged method like this:
protected override void OnActiveEditor_ValueChanged(object sender, EventArgs e)
BaseEdit edit = sender as BaseEdit;
if (edit != null && this.EditingCell.RowHandle > 0)
Here is the problem: If my ColumnEdit is TextEdit with FormatString (e.g.: numeric format string "n"), when i edit the cell value, the editor saves changes and formats text immediately. I can't continue to change cell value. I want editor formats cell value when i finish editing the cell. (e.g. when i change the active cell). I sent you a sample project that you can understand my problem completely.
On sample grid, change the income column on which row you want, but don't push enter key or change the cell. The editor formats text and sets my cursor position at start of the string.
How can i make this work?
Thank you for the question. It is not necessary to create your own custom GridView descendant to introduce the necessary functionality. All you need is to post changes within the ButtonClick event handler. I have slightly modified your sample to demonstrate this approach. Please let me know if this approach meet your requirements.
Is your intention to post an answer to your own question?
- If so, then proceed.
- If you simply wanted to post additional information, ask for further clarification, or to just say "Thanks!", please click Leave a Comment.
- If you wish to edit your original question, please use the Edit button in the Toolbox at the top right corner of that entry.