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

Enable RadMultipage client Side

7 Answers 204 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
mark
Top achievements
Rank 1
mark asked on 20 Apr 2009, 04:07 AM
Hi all,

I have tried in vain to  find code to enable  a radmultipage on the clientside.

basically i have an "Edit" button, whose functionality is to  change a tabstrip from readonly  to not readonly..

I  would be grateful if anyone out there  has got an example of this

Thanks

Mark

7 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 20 Apr 2009, 12:04 PM
Hi mark,

RadMultiPage does not support such a feature. However isn't it sufficient that the tabstrip is disabled? The user will not be able to change pageviews since the tabs are disabled.

Regards,
Albert
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
mark
Top achievements
Rank 1
answered on 20 Apr 2009, 06:29 PM
Hi Albert,

unfortunately it isnt enough to disable the tabstrip. we want the user to be able to see the contents of the tab but edit until they click an edit button


can this be achieved via updatepanels ?



Thanks
Mark
0
Paul
Telerik team
answered on 21 Apr 2009, 08:00 AM
Hi mark,

In general you can easily achieve your goal by setting the Enabled property of the pageview(s) to false. Still, it depends what controls you have in the pageviews.
 
    <telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="mpTest"   
        SelectedIndex="0">  
        <Tabs> 
            <telerik:RadTab runat="server" Text="View" Selected="True">  
            </telerik:RadTab> 
            <telerik:RadTab runat="server" Text="New">  
            </telerik:RadTab> 
        </Tabs> 
    </telerik:RadTabStrip> 
    <telerik:RadMultiPage ID="mpTest" runat="server" SelectedIndex="0">  
        <telerik:RadPageView ID="mpvTest1" runat="server" Enabled="false">  
            <asp:TextBox ID="TextBox1" runat="server">PageView 1</asp:TextBox> 
            <asp:Button ID="Button1" runat="server" Text="Button" /> 
        </telerik:RadPageView> 
        <telerik:RadPageView ID="mpvTest2" runat="server" Enabled="false">  
            <asp:TextBox ID="TextBox2" runat="server">PageView 2</asp:TextBox> 
            <asp:Button ID="Button2" runat="server" Text="Button" /> 
        </telerik:RadPageView> 
    </telerik:RadMultiPage> 

We do however recommend handling this at controls' level.

Best wishes,
Paul
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
mark
Top achievements
Rank 1
answered on 21 Apr 2009, 06:39 PM
Hi Paul,


I think you are missing my point, I would like to change either the pageview or the multipageview from enabled to disabled (or visaversa)  via javascript. i.e. user clicks on a button and the control becomes either enabled or disabled, thus reducing a postback

Thanks Mark
0
Paul
Telerik team
answered on 22 Apr 2009, 02:17 PM
Hi mark,

Here's a sample code snippet that shows the needed approach.

<html xmlns="http://www.w3.org/1999/xhtml">  
<head id="Head1" runat="server">  
    <title></title>  
</head> 
<body> 
    <form id="form1" runat="server">  
    <asp:ScriptManager runat="server" ID="smTest">  
    </asp:ScriptManager> 
 
    <script type="text/javascript">  
        function pageLoad(sender, eventArgs) {  
            var mp = $find('<%= mpTest.ClientID %>');  
            var grid = $find('<%= RadGrid1.ClientID %>')  
            var tableView = grid.get_masterTableView();  
            if (tableView.get_isItemInserted() == false) {  
                mp.get_pageViews().getPageView(0).get_element().disabled = true;  
            }  
            else {  
                mp.get_pageViews().getPageView(0).get_element().disabled = false;  
            }  
        }  
    </script> 
 
    <telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="mpTest" SelectedIndex="0">  
        <Tabs> 
            <telerik:RadTab runat="server" Text="View" Selected="True">  
            </telerik:RadTab> 
            <telerik:RadTab runat="server" Text="New">  
            </telerik:RadTab> 
        </Tabs> 
    </telerik:RadTabStrip> 
    <telerik:RadMultiPage ID="mpTest" runat="server" SelectedIndex="0">  
        <telerik:RadPageView ID="mpvTest1" runat="server">  
            <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" AutoGenerateEditColumn="True" 
                DataSourceID="SqlDataSource1" GridLines="None" ShowGroupPanel="True">  
                <MasterTableView AutoGenerateColumns="False" DataKeyNames="ProductID" DataSourceID="SqlDataSource1" 
                    CommandItemDisplay="Top">  
                    <RowIndicatorColumn> 
                        <HeaderStyle Width="20px" /> 
                    </RowIndicatorColumn> 
                    <ExpandCollapseColumn> 
                        <HeaderStyle Width="20px" /> 
                    </ExpandCollapseColumn> 
                    <Columns> 
                        <telerik:GridBoundColumn DataField="ProductID" DataType="System.Int32" HeaderText="ProductID" 
                            ReadOnly="True" SortExpression="ProductID" UniqueName="ProductID">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="ProductName" HeaderText="ProductName" SortExpression="ProductName" 
                            UniqueName="ProductName">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="SupplierID" DataType="System.Int32" HeaderText="SupplierID" 
                            SortExpression="SupplierID" UniqueName="SupplierID">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="CategoryID" DataType="System.Int32" HeaderText="CategoryID" 
                            SortExpression="CategoryID" UniqueName="CategoryID">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="QuantityPerUnit" HeaderText="QuantityPerUnit" 
                            SortExpression="QuantityPerUnit" UniqueName="QuantityPerUnit">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="UnitPrice" DataType="System.Decimal" HeaderText="UnitPrice" 
                            SortExpression="UnitPrice" UniqueName="UnitPrice">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="UnitsInStock" DataType="System.Int16" HeaderText="UnitsInStock" 
                            SortExpression="UnitsInStock" UniqueName="UnitsInStock">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="UnitsOnOrder" DataType="System.Int16" HeaderText="UnitsOnOrder" 
                            SortExpression="UnitsOnOrder" UniqueName="UnitsOnOrder">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="ReorderLevel" DataType="System.Int16" HeaderText="ReorderLevel" 
                            SortExpression="ReorderLevel" UniqueName="ReorderLevel">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridCheckBoxColumn DataField="Discontinued" DataType="System.Boolean" HeaderText="Discontinued" 
                            SortExpression="Discontinued" UniqueName="Discontinued">  
                        </telerik:GridCheckBoxColumn> 
                        <telerik:GridBoundColumn DataField="CategoryName" HeaderText="CategoryName" SortExpression="CategoryName" 
                            UniqueName="CategoryName">  
                        </telerik:GridBoundColumn> 
                    </Columns> 
                </MasterTableView> 
                <ClientSettings AllowDragToGroup="True">  
                    <%--<ClientEvents OnGridCreated="OnGridCreated" />--%> 
                </ClientSettings> 
            </telerik:RadGrid> 
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>" 
                SelectCommand="SELECT * FROM [Alphabetical list of products]"></asp:SqlDataSource> 
        </telerik:RadPageView> 
        <telerik:RadPageView ID="mpvTest2" runat="server" Enabled="false">  
            <asp:TextBox ID="TextBox2" runat="server">PageView 2</asp:TextBox> 
            <asp:Button ID="Button2" runat="server" Text="Button" /> 
        </telerik:RadPageView> 
    </telerik:RadMultiPage> 
    </form> 
</body> 
</html> 



Greetings,
Paul
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Marco
Top achievements
Rank 1
answered on 30 Aug 2011, 07:54 PM
Hi, I tried this solution but it doesn't work.

<rad:RadM
<rad:RadMultiPage ID="radPages" runat="server" SelectedIndex="6">
                        <rad:RadPageView ID="radPageDetails" runat="server" Enabled="False">

But once the page is displayed, the screen is still enabled.  I would rather have the radPageView visible but protected from any data entry.

Please help.
0
Dimitar Terziev
Telerik team
answered on 01 Sep 2011, 04:17 PM
Hi Marco,

Could you clarify which version of the controls you are using? In general if you have set the Enable property to false the pageview should be visible, but the controls in it should be disabled.

Best wishes,
Dimitar Terziev
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
TabStrip
Asked by
mark
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
mark
Top achievements
Rank 1
Paul
Telerik team
Marco
Top achievements
Rank 1
Dimitar Terziev
Telerik team
Share this question
or