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

how to update UI when deleting grid row?

2 Answers 103 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jayd
Top achievements
Rank 1
Jayd asked on 28 Mar 2011, 06:39 PM
I have a RadGrid with a GridButtonColumn that has CommandName="Delete".  When I click this button, the events for ItemCommand and DeleteCommand both fire.  In the ItemCommandEvent I run some code to delete the record from the database.

The record gets deleted from the DB, but the row still exists on the UI.  I've tried calling the Rebind() and DataBind() methods on my radgrid, but that makes no difference.

I've also tried using a GridClientDeleteColumn instead of the GridButtonColumn.  This causes the row to disappear from the UI, but no server-side events fire, so I cannot actually delete the data from the DB.

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 29 Mar 2011, 08:19 AM
Hello Jayd,

How do you populating RadGrid? If you are using any advanced feature in grid(like insert/delete/update operation), then a better approach is populating RadGrid using "AdvancedData binding" using NeedDataSource event.

For more information about this can be available here.
Advanced Data-binding (using NeedDataSource event)

Also Go through the following links and see whats missing in your case.
Manual Insert/Update/Delete operations using Auto-generated editform with sql statements from the code-behind:
Manual Insert/Update/Delete using FormTemplate and Sql backend

Thanks,
Princy.
0
Jayd
Top achievements
Rank 1
answered on 29 Mar 2011, 04:53 PM
I didn't realize until now that the grid was in an update panel with UpdateMode="Conditional".  I am now calling Update() on the update panel and the UI reflects that the record was deleted.

Thanks.
Tags
Grid
Asked by
Jayd
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Jayd
Top achievements
Rank 1
Share this question
or