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

Hide and show radgrid on its buttonclick

1 Answer 119 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ryann
Top achievements
Rank 1
Ryann asked on 05 Dec 2013, 12:34 PM
Hi.
I have two buttons.one to show radgrid and one to hide it. Can i hide and show radgrid on its buttonclick in clientside using javascript?

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 05 Dec 2013, 12:46 PM
Hi Ryann,

Please try the following code snippet to show and hide Grid on Button Click.

ASPX:
<telerik:RadButton ID="RadButton1" runat="server" Text="Show grid" OnClientClicking="ShowGrid" AutoPostBack="false" />
<telerik:RadButton ID="RadButton2" runat="server" Text="Hide grid" OnClientClicking="HideGrid" AutoPostBack="false" />

JS:
<script type="text/javascript">
    function ShowGrid() {
        $find("<%=RadGrid1.ClientID%>").get_element().style.display = "";
    }
    function HideGrid() {
        $find("<%=RadGrid1.ClientID%>").get_element().style.display = "none";
    }
</script>

Thanks,
Princy
Tags
Grid
Asked by
Ryann
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or