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

Why no client set_text/get_text for RadDock?

4 Answers 52 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Christoffer Rosenqvist
Top achievements
Rank 1
Christoffer Rosenqvist asked on 07 May 2010, 03:52 PM
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

4 Answers, 1 is accepted

Sort by
0
Christoffer Rosenqvist
Top achievements
Rank 1
answered on 11 May 2010, 09:01 AM
Is it possible to at least get a little input on this?
0
Pero
Telerik team
answered on 12 May 2010, 12:25 PM
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.
0
Christoffer Rosenqvist
Top achievements
Rank 1
answered on 12 May 2010, 12:39 PM
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?
0
Pero
Telerik team
answered on 14 May 2010, 11:38 AM
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.
Tags
Dock
Asked by
Christoffer Rosenqvist
Top achievements
Rank 1
Answers by
Christoffer Rosenqvist
Top achievements
Rank 1
Pero
Telerik team
Share this question
or