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

Change Root PanelBar Text?

5 Answers 128 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Najid Hanif
Top achievements
Rank 2
Najid Hanif asked on 06 Aug 2012, 12:29 PM
How can I change the Root PanelBar Text from code behind?

Thanks

5 Answers, 1 is accepted

Sort by
0
Accepted
Kalina
Telerik team
answered on 06 Aug 2012, 03:50 PM
Hello Najid Hanif,

You can try to find the RadPanelItem by Value and to change the Text in this way:
<telerik:RadPanelBar runat="server" ID="RadPanelBar1" Height="300px">
<Items>
<telerik:RadPanelItem Text="ASP.NET controls" Value="1">
<Items>
    <telerik:RadPanelItem Text="RadMenu" Value="2">
    </telerik:RadPanelItem>
    <telerik:RadPanelItem Text="RadTabStrip" Value="3">
    </telerik:RadPanelItem>
    <telerik:RadPanelItem Text="RadPanelBar" Value="4">
    </telerik:RadPanelItem>
    <telerik:RadPanelItem Text="RadTreeView" Value="5">
    </telerik:RadPanelItem>
</Items>
</telerik:RadPanelItem>
</Items>
</telerik:RadPanelBar

protected void Page_Load(object sender, EventArgs e)
{
    RadPanelItem item = this.RadPanelBar1.FindItemByValue("1");
    item.Text = "Changed text";
}

All the best,
Kalina
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.
0
Adeel
Top achievements
Rank 1
answered on 06 Oct 2012, 01:00 PM
How can we set a text value of this lable where ID="lblEmailAdd", when page is load?

<telerik:RadPanelBar runat="server" ID="RadPanelBar1" Width="670px">
                <Items>
                    <telerik:RadPanelItem Expanded="True" Text="Contact Information" runat="server" Selected="true"> 
                        <Items>
                            <telerik:RadPanelItem Value="AccountInformation" runat="server">
                                <ItemTemplate>
                                <div class="myData">
                                   <div class="myLables">Email Address:</div>
                                   <div class="myControls">
                                       <asp:Label ID="lblEmailAdd" runat="server" Text="Label"></asp:Label>
                                      </div><hr />
</ItemTemplate>


0
Princy
Top achievements
Rank 2
answered on 08 Oct 2012, 03:40 AM
Hi Adeel,

Try the following code snippet to set the text of the label.

C#:
protected void Page_Load(object sender, EventArgs e)
    {
        RadPanelItem item = RadPanelBar1.FindItemByValue("AccountInformation");
        Label lblEmailAdd = (Label)item.FindControl("lblEmailAdd");
        lblEmailAdd.text = "Your text";
    }

Hope this helps.

Regards,
Princy.
0
Adeel
Top achievements
Rank 1
answered on 09 Oct 2012, 06:21 PM
Thanks.
0
Adeel
Top achievements
Rank 1
answered on 09 Oct 2012, 06:36 PM
I have another question, I use Panel bar for Personal Information and its look like:

Email: abc@com
Name: Abc
etc.

now at end I mention a edit button. How can I achieve this functionality when user click on edit button than another panel bar is coming and convert all my data(abc@com) into textboxes. I have attached two pictures which show my all scena

Thanks
Tags
PanelBar
Asked by
Najid Hanif
Top achievements
Rank 2
Answers by
Kalina
Telerik team
Adeel
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or