Enable RadMultipage client Side

8 posts, 0 answers
  1. mark
    mark avatar
    19 posts
    Member since:
    May 2008

    Posted 19 Apr 2009 Link to this post

    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
  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 20 Apr 2009 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. mark
    mark avatar
    19 posts
    Member since:
    May 2008

    Posted 20 Apr 2009 Link to this post

    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
  5. Paul
    Admin
    Paul avatar
    4281 posts

    Posted 21 Apr 2009 Link to this post

    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.
  6. mark
    mark avatar
    19 posts
    Member since:
    May 2008

    Posted 21 Apr 2009 Link to this post

    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
  7. Paul
    Admin
    Paul avatar
    4281 posts

    Posted 22 Apr 2009 Link to this post

    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.
  8. Marco
    Marco avatar
    5 posts
    Member since:
    Jul 2010

    Posted 30 Aug 2011 Link to this post

    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.
  9. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1266 posts

    Posted 01 Sep 2011 Link to this post

    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 >>

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017