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

Splitter to Show/Hide Command Item Template on Rad Grid

1 Answer 136 Views
Splitter
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 08 Nov 2011, 05:38 PM
Hi,

I would like to use a Rad Splitter to show and hide the Command Item Template.

The functionality would be sililar to this example:
http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandsplitterresizing/defaultcs.aspx?product=splitter

Please advise if this is possible.


Thanks in advance,

Ryan

1 Answer, 1 is accepted

Sort by
0
Dobromir
Telerik team
answered on 11 Nov 2011, 04:03 PM
Hi Matt,

RadGrid does not offer the required functionality out of the box. Nevertheless, you can achieve the required result by having a custom buttons outside the grid (in this case in the other RadPane) to and manually fire the grid commands using the MaterTableView's fireCommand() client-side method, e.g:
<telerik:RadSplitter ID="RadSplitter1" runat="server" Orientation="Horizontal">
    <telerik:RadPane ID="gridPane" runat="server">
        <telerik:RadGrid ID="RadGrid1" runat="server">
        </telerik:RadGrid>
    </telerik:RadPane>
    <telerik:RadSplitBar CollapseMode="Both" ID="RadSplitBar2" runat="server" EnableResize="True">
    </telerik:RadSplitBar>
    <telerik:RadPane ID="commandsPane" runat="server" CssClass="TextStyle" BackColor="#d9eeff">
        <asp:Button Text="Add New Item" runat="server" ID="Button1" OnClientClick="fireGridCommand('InitInsert', ''); return false;" />
        <asp:Button Text="Refresh" runat="server" ID="Button2" OnClientClick="fireGridCommand('InitInsert', ''); return false;" />
    </telerik:RadPane>
</telerik:RadSplitter>
 
<script type="text/javascript">
    function fireGridCommand(commandName, commandArgument)
    {
        var masterTableView = $find("RadGrid1").get_masterTableView();
        masterTableView.fireCommand(commandName, commandArgument);
    }
</script>


More detailed information regarding this method is available in the following help article:
http://www.telerik.com/help/aspnet-ajax/grid-gridtableview-firecommand.html

Kind regards,
Dobromir
the Telerik team
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 their blog feed now
Tags
Splitter
Asked by
Mark
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
Share this question
or