RadGrid IsDirty property

5 posts, 0 answers
  1. Leszek
    Leszek avatar
    8 posts
    Member since:
    Jul 2012

    Posted 10 Apr 2015 Link to this post

    Hi,

    I have several InPlace editable RadGrids on my page located in an asp:DetailsView (together with other fields). The problem is when users update the grid(s) and do not commit changes by pressing the small Update button in a grid's row. Then, when they press the Update button of DetailsView all their changes are lost.

    Is there any way to determine if a grid has any pending changes? Something like RadGrid.IsDirty property?

    Thanks,

    Leszek

     

  2. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 13 Apr 2015 Link to this post

    Hello,
     
    You can use the built-in batch editing functionality of the grid to achieve your goal. RadGrid's Batch editing functionality enables inline client-side editing and performing multiple changes before the user decides to either apply the changes or cancel them. More information and online example are available below:
    http://demos.telerik.com/aspnet-ajax/grid/examples/data-editing/batch-editing/defaultcs.aspx
    http://www.telerik.com/help/aspnet-ajax/grid-batch-editing.html

    Regards,
    Pavlina
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Leszek
    Leszek avatar
    8 posts
    Member since:
    Jul 2012

    Posted 13 Apr 2015 in reply to Pavlina Link to this post

    Thank you Pavlina for your response. I'm aware of batch editing but it does not fit my business requirements. My users need to update one row at a time and commit or cancel changes per row. InPlace editing is perfect for that. Besides, would batch editing allow me to determine if there are any pending (uncommitted) changes in a grid? I need to know that as I have to prevent users from submitting the form using the asp.net DetailsView's Update button. It's also lots of work for me at this point to convert all the grids (which use Ajax etc.) from InPlace mode to Batch mode.

    I have another idea and I would appreciate your opinion on that: how about I would attach an onchange JavaScript event to each and every control in a grid and track if there has been any change? This way I would have a centralized place (a hidden field I guess) that would indicate if the onchange event has been fired. This would be my IsDirty property. Is it a good idea?

    Thanks,

    Leszek

     

  5. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 15 Apr 2015 Link to this post

    Hello Leszek,

    To track if there has been any change in the grid you can use hasChanges() method of the Batch Editing Manager.
    var grid=$telerik.findControl(document,"RadGrid1");
    grid.get_batchEditingManager().hasChanges(grid.get_masterTableView());

    You can check if the second line returns true or false on button click.

    Regards,
    Pavlina
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  6. Jaya
    Jaya avatar
    81 posts
    Member since:
    Mar 2011

    Posted 22 Apr 2015 in reply to Pavlina Link to this post


    Hi

    Admin

    Can you solve this 

    http://www.telerik.com/forums/how-to-designed-the-aspx-page-and-open-rad-window
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017