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

RadGrid Rebind After Nested Table

1 Answer 184 Views
Grid
This is a migrated thread and some comments may be shown as answers.
DanR
Top achievements
Rank 1
DanR asked on 14 Oct 2010, 05:55 AM
Hi:

I have a nested table as part of a radgrid. The user is able to expand the nested table, then add, update and delete using a popup form. I am updating information for the master DB that shows in radgrid1 after each change (totals). When I close the nested table and return to displaying the main grid, the totals do not refresh (even though they are updated in the database). I have tried adding RadGrid1.MasterTableView.Rebind() to the itemupdated, itemdeleted and iteminserted commands, but it is not working for me. Would it make sense to use javascript to force a rebind on radgrid1 when the user collapses the nested table? If so, how can I call a javascript function at the time the nested grid is collapsed? I think this function would work if I can execute it at the right time:

function NestedTableCollapsing(sender, args) {
    var masterTable = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
    masterTable.rebind();
}

Thanks, Dan

1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 20 Oct 2010, 08:03 AM
Hello Dan Roth,

I would suggest that you rebind your parent table view on the UpdateCommand event handler. The second parameter of this handler provides a reference to the item currently updated, and you can use it to get a reference to its parent item table view:

protected void RadGrid1_UpdateCommand(object source, GridCommandEventArgs e)
{
    //Update the detail table item
    e.Item.OwnerTableView.ParentItem.OwnerTableView.Rebind();
}

I have also attached a small sample that demonstrates this approach.

I hope this helps

Regards,
Martin
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
DanR
Top achievements
Rank 1
Answers by
Martin
Telerik team
Share this question
or