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

Keep detail grid expanded after insert and rebind

6 Answers 200 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Laura
Top achievements
Rank 1
Laura asked on 17 Mar 2009, 02:34 PM
I have a radgrid with 3 level hierarchy. I am using a custom rad popup window to the insert and edit. When I insert or edit an item in a child grid, after the radwindow closes, I am calling rebind by calling 
$find("<%= RadAjaxManager1.ClientID %>").ajaxRequest(); in the onClientClose on the client to call rebind on the server. I just read that you cannot use rebind for detail records, and need to set up a DetailTableDataBind event, but if I am invoking the ajaxRequest after the window closes, how can I rebind the detail grid and keep it expanded?

Thanks,
Laura

6 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 18 Mar 2009, 04:54 AM
Hi Laura,

Here is a code library submission which explains how to retain the expanded state of the hierarchical Grid on rebind. Go through it and see if it helps.
Retain expanded/selected state in hierarchy on rebind

Thanks
Shinu
0
Laura
Top achievements
Rank 1
answered on 18 Mar 2009, 11:47 AM
Thank you for your help as always. It works perfectly.
0
Laura
Top achievements
Rank 1
answered on 24 Mar 2009, 08:12 PM
Actually, this works except in one situation. If my detail grid has paging, and I edit an item on any page but the first, on the closing of the edit radwindow, the grid stays expanded, but goes back to the first page of the detail grid. Is there a way to keep the current page for the detail grid there?

Thanks,
Laura
0
Yavor
Telerik team
answered on 25 Mar 2009, 07:30 AM
Hello Laura,

You can also change the page, by setting TableInstance.CurrentPageIndex. This will ensure that the control is not on the first page.

Greetings,
Yavor
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Laura
Top achievements
Rank 1
answered on 25 Mar 2009, 01:20 PM
Can you please explain in more detail what I need to do? Thank you
0
Yavor
Telerik team
answered on 30 Mar 2009, 10:33 AM
Hi Laura,

Every table instance in the control has a currentPageIndex - be it the MasterTable, or any of the detail tables. For the master table, you can set it directly. For any other table, you will first need to reference the respective detail table.
I hope this information helps.

Kind regards,
Yavor
the Telerik team

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