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

A couple of questions about DetailTables

3 Answers 86 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Lucania
Top achievements
Rank 1
Lucania asked on 19 Jul 2011, 07:27 AM
Hi,

I'm relatively new to RadControls, and have a couple of questions about using DetailTables inside RadGrid.

1. My detail GridTableView has a delete button that uses the Delete Command, and that works fine, but I want another detail grid on the page to be updated (via ajax) when that happens. I added the master RadGrid as a control to initiate an update, and the other grid as the AjaxUpdatedControl, but deleting a detail record does not seem to cause an update in the other detail table. Do I need to do something else to achieve this?

1a. I acheved the result I want using a nested RadGrid in an edit form on the master, and trapping the OnItemDeleted event, but that seems like the long way round, and the UI is more cumbersome, I'd really rather use the DetailTables if I can.

Thanks for any help,

ROSCO

3 Answers, 1 is accepted

Sort by
0
Lucania
Top achievements
Rank 1
answered on 20 Jul 2011, 01:32 AM
I did this by trapping the DataSource.OnDeleted, and re-binding the detail table there.

Is it possible to provide OnItemDeleted (and Inserted, et al) in the GridTableView as well?

ROSCO
0
Vasil
Telerik team
answered on 22 Jul 2011, 07:35 AM
Hi Ross,

You could use Client-side Hierarchy Loading for loading the detail tables without updating the whole grid.
About your second question: ItemCreated, ItemDeleted and so on (the 'item' events) are fired for the grid itself. However you could use Parent property of each item to determinate in which table view is located.
For example:
protected void RadGrid1_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
{
 
    GridTableView parentTable = e.Item.Parent as GridTableView;
    if (parentTable != null && parentTable.Name = "The name of your table")
    {
        //do some custom logic;
    }
}

Regards,
Vasil
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Lucania
Top achievements
Rank 1
answered on 25 Jul 2011, 12:08 AM
Thanks!

ROSCO
Tags
Grid
Asked by
Lucania
Top achievements
Rank 1
Answers by
Lucania
Top achievements
Rank 1
Vasil
Telerik team
Share this question
or