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

DeleteCommand in ChildTable not updating MasterTable

1 Answer 67 Views
Grid
This is a migrated thread and some comments may be shown as answers.
CBARS
Top achievements
Rank 2
CBARS asked on 09 Jan 2009, 02:08 PM
I have a RadGrid whose MasterTable is being filled through the NeedDataSource() method of the grid. I have one child table, that is filled in the DetailTableDataBind() method.

I capture the ItemCommand event for the grid, check whether it is Delete, and then determine the OwnerTableView to check if I should delete from the MasterTable's DataSource or the ChildTable's DataSource.

When I delete a MasterTable row, it works fine.

When I delete a ChildTable row, the data store is updated, but after running NeedDataSource() (I call RadGrid1.MasterTableView.ReBind() from the ItemCommand event handler), only the ChildTable is updated. My MasterTable contains a total of a column in the ChildTable, and the change to the data store is not reflected on the grid.

The RadGrid is currently set up as an UpdatedControl when itself changes, e.g.

<telerik:AjaxSetting AjaxControlID="RadGrid1"
   <UpdatedControls>                             
        <telerik:AjaxUpdatedControl ControlID="RadGrid1"  
                 LoadingPanelID="RadAjaxLoadingPanel1" />                             
   </UpdatedControls> 
</telerik:AjaxSetting> 

Is there a way to "reset" the RadGrid, and refill it with data? Or is that what NeedDataSource() does? Anything that I can try that might remedy this situation?

1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 12 Jan 2009, 11:28 AM
Hi cbars,

One possible option in this case would be to call the Rebind() method for the grid control, which would ensure that it rebinds, and fetches the most recent set of records from the data source.
I hope this suggestion helps.

Greetings,
Yavor
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
CBARS
Top achievements
Rank 2
Answers by
Yavor
Telerik team
Share this question
or