Deleting db records AND grid rows.

2 posts, 0 answers
  1. Paul
    Paul avatar
    16 posts
    Member since:
    Feb 2016

    Posted 04 May Link to this post

    I have a radgrid which displays records from a database. I need to be able to delete records. However, I need to do two things: 1) Delete the actual record from the database, and 2) delete the row from the client side grid display. In all my Googling on this, it seems I have to pick one or the other, and can't do both together. I can have a GridButtonColumn which fires the OnDeleteCommand, in which case I can delete the record from the database. But this doesn't update the grid display in the browser. Or, I can use the GridClientDeleteColumn, which removes the row from the client grid display, but doesn't fire the OnDeleteCommand, so I can't delete the record from the database. I want to delete the record from the database AND remove the record from the client radgrid. How do I do this?

    (IIS 7.5, Windows Server 2012, VS 2012, C#, ASP.NET, Telerik runtime version 4.0.30319, IE11, Firefox 45.0)
  2. Paul
    Paul avatar
    16 posts
    Member since:
    Feb 2016

    Posted 05 May Link to this post

    Ok, I figured this out. I knew I could do it by rebinding the grid, but I assumed this would "reset" the grid to page 1, so that if the user deleted a record from page 12 of 50, for example, reseting the grid back to page 1 would be confusing and definitely not "awesome". But I tried it anyway. The result is that the row just disappears from the grid, no matter what page I'm on, which is exactly what I needed.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top