This is a migrated thread and some comments may be shown as answers.

Deleting db records AND grid rows.

1 Answer 98 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 04 May 2016, 03:37 PM
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)

1 Answer, 1 is accepted

Sort by
0
Paul
Top achievements
Rank 1
answered on 05 May 2016, 01:00 PM
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.
Tags
Grid
Asked by
Paul
Top achievements
Rank 1
Answers by
Paul
Top achievements
Rank 1
Share this question
or