Change Root PanelBar Text?

6 posts, 1 answers
  1. Najid Hanif
    Najid Hanif avatar
    92 posts
    Member since:
    Jul 2011

    Posted 06 Aug 2012 Link to this post

    How can I change the Root PanelBar Text from code behind?

    Thanks
  2. Answer
    Kalina
    Admin
    Kalina avatar
    918 posts

    Posted 06 Aug 2012 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Adeel
    Adeel avatar
    8 posts
    Member since:
    Oct 2012

    Posted 06 Oct 2012 Link to this post

    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>


  5. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 07 Oct 2012 Link to this post

    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.
  6. Adeel
    Adeel avatar
    8 posts
    Member since:
    Oct 2012

    Posted 09 Oct 2012 Link to this post

    Thanks.
  7. Adeel
    Adeel avatar
    8 posts
    Member since:
    Oct 2012

    Posted 09 Oct 2012 Link to this post

    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
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017