Ticket Q361023
Visible to All Users
Duplicate

web grid inline editing

created 13 years ago

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"?

Answers

created 13 years ago

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

    Comments (2)

      Hi Anatol,

      How can i load the same item in detaile view for the above, instead of editing inline?

      Anatol (DevExpress) 8 years ago

        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.

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.