I use grid row inling eding in my web application.
When i click edit and row becomes editable if i do some changes and then instead of click save if i click on another row,i lose changes.Can i somehow pop up a message "changes will be lost do you want to keep them etc"?
We have closed this ticket because another page addresses its subject:
UI.Web - Show a confirmation dialog when a user leaves a page with modified data or changes the current objectweb grid inline editing
Answers
Hello Makis,
Yes, this is possible. You can use the following controller:
C#public class ViewController1 : ViewController<ListView> {
protected override void OnViewControlsCreated() {
base.OnViewControlsCreated();
ASPxGridListEditor gridListEditor = View.Editor as ASPxGridListEditor;
if (gridListEditor != null) {
gridListEditor.Grid.ClientInstanceName = "aspxGridView1";
gridListEditor.Grid.HtmlDataCellPrepared += new DevExpress.Web.ASPxGridView.ASPxGridViewTableDataCellEventHandler(Grid_HtmlDataCellPrepared);
}
}
void Grid_HtmlDataCellPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableDataCellEventArgs e) {
e.Cell.Attributes["onclick"] = String.Format("if ({0}.IsEditing() && !confirm('Do you want to cancel changes?')) {1}", ((ASPxGridView)sender).ClientInstanceName, RenderHelper.EventCancelBubbleCommand);
}
}
Please let me know if you need any further help.
Thanks,
Anatol
Hi Anatol,
How can i load the same item in detaile view for the above, instead of editing inline?
Hello Mithun,
I've created a separate ticket on your behalf (T485466: How to load an item in a DetailView instead of inline editing). It has been placed in our processing queue and will be answered shortly.