Why no client set_text/get_text for RadDock?

5 posts, 0 answers
  1. Christoffer Rosenqvist
    Christoffer Rosenqvist avatar
    28 posts
    Member since:
    Oct 2009

    Posted 07 May 2010 Link to this post

    I would love to use a client side function to set the text of a RadDock in a way that is reflected also on the serverside in the DockState.Text object. Is this possible, since there is no set_text function on the client side object.

    //Christoffer
  2. Christoffer Rosenqvist
    Christoffer Rosenqvist avatar
    28 posts
    Member since:
    Oct 2009

    Posted 11 May 2010 Link to this post

    Is it possible to at least get a little input on this?
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Pero
    Admin
    Pero avatar
    1156 posts

    Posted 12 May 2010 Link to this post

    Hi Christoffer,

    RadDock's Text property is not exposed on the client, and that's why it cannot be set using client code. In case you require that the property is accessed on the client, my recommendation is to use a HiddenField for every dock, to store the value of the Text property. The value of the HiddenField can be easily changed on the client.

    Greetings,
    Pero
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  5. Christoffer Rosenqvist
    Christoffer Rosenqvist avatar
    28 posts
    Member since:
    Oct 2009

    Posted 12 May 2010 Link to this post

    Hi Pero, thanks for getting back to me on this one.

    What I need is a way to set some info for a RadDock that will be reflected in the DockState on the server side after a postback. I'm guessing there's no way for the hiddenfield you suggest to be reflected on the server side, or is there?
  6. Pero
    Admin
    Pero avatar
    1156 posts

    Posted 14 May 2010 Link to this post

    Hi Christoffer,

    When the value of a HiddenField control is set on the client, it will persist its value on the server. Here is an example:
    .aspx
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <head id="Head1" runat="server">
        <title></title>
        <telerik:RadScriptBlock runat="server">
     
            <script type="text/javascript">
                function SetValue()
                {
                    var hiddenField = $get("<%=HiddenField1.ClientID %>");
                    hiddenField.value = "Some value set on the client!";
                }
            </script>
     
        </telerik:RadScriptBlock>
    </head>
    <body>
        <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
            <Scripts>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            </Scripts>
        </asp:ScriptManager>
        <div>
            <input type="button" onclick="SetValue(); return false;" value="Set Value Hidden Field" /><br />
            <br />
            <asp:Button ID="Button1" runat="server" Text="Postback" />
            <asp:Label ID="Label1" runat="server"></asp:Label>
            <telerik:RadDockLayout ID="RadDockLayout1" runat="server">
                <telerik:RadDockZone ID="RadDockZone1" runat="server" MinHeight="300px" Width="300px">
                    <telerik:RadDock ID="RadDock1" runat="server" Title="RadDock-Title" Width="300px">
                        <ContentTemplate>
                            <asp:HiddenField ID="HiddenField1" runat="server" />
                            <br />
                            <br />
                            <br />
                            <br />
                            <br />
                            CONTENT
                            <br />
                            <br />
                            <br />
                            <br />
                            <br />
                        </ContentTemplate>
                    </telerik:RadDock>
                </telerik:RadDockZone>
            </telerik:RadDockLayout>
        </div>
        </form>
    </body>
    </html>

    .cs
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using Telerik.Web.UI;
     
    public partial class Default_Dock : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Label1.Text = HiddenField1.Value;
        }
    }


    Regards,
    Pero
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017