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

Toggling group panel on the client side

4 Answers 65 Views
Grid
This is a migrated thread and some comments may be shown as answers.
dmw
Top achievements
Rank 1
dmw asked on 19 Nov 2010, 01:07 PM
Hi,

What's the best way of showing/hiding the group panel without doing a postback? I couldn't find an equivalent of hideFilterItem() / showFilterItem() for the group panel.

Thanks,

4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 22 Nov 2010, 07:06 AM
Hello,


The following code will help you to toggle the GroupPanel visibility from client side.

JavaScript:
<script type="text/javascript">
    function showHide() {
        var grid = $find("<%=  RadGrid1.ClientID%>");
        grid._groupPanel.set_visible(!grid._groupPanel.get_visible());
    }
</script>



-Shinu.
0
dmw
Top achievements
Rank 1
answered on 22 Nov 2010, 11:12 AM
Thanks, there seems to be a couple of problems with this:

1) If the group panel is initially hidden (ShowGroupPanel="false"), the _groupPanel property appears to be missing.

2) If the group panel is shown and I hide it using this method, it reappears after the next postback (e.g. re-sorting).
0
Tsvetina
Telerik team
answered on 25 Nov 2010, 10:29 AM
Hello,

Since the set_visible() property hides the group panel only on the client, you need to persist the visible state manually after postback. For example you can use a hidden field on the page which value you set when the showHide() method is called. It will notify whether the group panel should be visible after postback, or not (you can set this state in the ItemCreated event handler of the grid).

Regards,
Tsvetina
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
dmw
Top achievements
Rank 1
answered on 25 Nov 2010, 03:58 PM
Thanks for the suggestion, I'll give it a try.
Tags
Grid
Asked by
dmw
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
dmw
Top achievements
Rank 1
Tsvetina
Telerik team
Share this question
or