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

HeirArchy Grid Edit in DetailTable

1 Answer 39 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 16 Dec 2013, 10:03 PM
I have an edit Icon on the far right column of the grid and when a users clicks on it how can I get the grid to expand all of it's children just like the arrow does on the left hand side?

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 19 Dec 2013, 08:52 AM
Hello Mike,

I suppose you mean the ExpandAll functionality demonstrated in the following sample:
http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/declarative-relations/defaultcs.aspx

You can achieve this on an external button click using this approach:

<script type="text/javascript">
    //Put your JavaScript code here.
    function expandAllGridItems() {
        var masterTable = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
        var expandAllButton = $telerik.findElement(masterTable.HeaderRow, "AllBtnExpandColumn");
        expandAllButton.click();
    }
</script>
<asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="expandAllGridItems(); return false;" />

Hope this helps. Please give it a try and let me know if it works for you.

Regards,
Eyup
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Grid
Asked by
Mike
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or