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

[Solved] Triggering an AJAX call outside of the grid on an expanded table within hierarchy

1 Answer 53 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Alexei
Top achievements
Rank 1
Alexei asked on 01 Apr 2009, 01:27 PM
Hi,

There is an example for Triggering an AJAX call outside of the grid

Can I do this on an expanded table within hierarchy while preserving the state of the hierarchy? Any tips?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 06 Apr 2009, 09:17 AM
Hi Alexei,

You can update for instance the GridViewTable placed in the expanded row with Ajax call outside of the grid. To accomplish this task first you need to perform an Ajax call:
           <input 
               id="btnClient" 
               type="button" 
               value="Make client AjaxRequest" 
               onclick="clientClick();" /> 


On the server-side you can perform an update of the expanded row, for example review the following code:
    protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e) 
    { 
        if (e.Argument == "OutsideAjax")  
        { 
            foreach (GridItem item in RadGrid1.MasterTableView.Items)  
            { 
                if (item.Expanded && item.HasChildItems) 
                { 
                    //TODO 
                    //((Telerik.Web.UI.GridDataItem)(item)).ChildItem.NestedTableViews[0].Items[0] 
                    break
                } 
            } 
        } 
    } 
Please have in mind that in order to preserve the state of the grid, you should use advanced data-binding. If you perform an update of the nested-view item the main grid will be rebound, too.

For further information about OnAjaxRequest event please review this online help article.

Greetings,
Georgi Krustev
the Telerik team

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