Anyway, we have bound the data succesfully, but we would like to avoid automatic "commit" of the edit until the user wants to do so (pressing "Enter", clicking a button...)
We tried with a button; in the event handler for click we inserted the line
private
void
btnSave_Click(
object
sender, RoutedEventArgs e)
{
this
.RadGridView1.CommitEdit();
}
Which is the correct way to do so?
Thanks,
Lorenzo
6 Answers, 1 is accepted
You may try to use the CellEditEnded and RowEditEnded events of the RadGridView. More information about the Updating an Entry can be found in our online documentation. Furthermore, in case it could be of any help for your scenario, you may take a look at our online example for different types of Edit Templates.
Maya
the Telerik team

Thank you for the reply.
Actually, I would like to do "the other way around": I don't need to be notified of when an edit starts or ends, but I want to trigger the end of the edit. I thought "CommitEdit" was the right thing to do, but it's not working (the grid row remains in edit mode, with the editable textboxes and so on). Maybe is it because the CommitEdit is called from within the row? (The button is in the DetailsView of the current row in edit mode).
Cheers,
Lorenzo
I have prepared a sample project following the requirements of editing with RowDetails and submitting the changes with a button click.
In case that it does not meet your exact requirements, please share more details about your application and its settings. It would be great if you could send us a sample project illustrating the main idea of it.
Maya
the Telerik team

Lorenzo

Error 1 Could not load file or assembly 'Telerik.Windows.Controls, Version=2010.2.714.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515) C:\devwork\Telerik datagrid\EditWithRowDetails_COmmitEdit\MainWindow.xaml 1 1 EditWithRowDetails_COmmitEdit
I have updated the sample so that it uses the binaries from our current official release Q3 2010. I hope you will not have troubles running the project now. Still, you may take a look at the code - MainWindow.xaml and MainWindow.xaml.cs and use the most important par of it - the definition of the RowDetailsTemplate and the way the Click event of the RadButton is handled.
Maya
the Telerik team