RadToolBarDropDown Text

2 posts, 1 answers
  1. Robert
    Robert  avatar
    68 posts
    Member since:
    Feb 2009

    Posted 06 Dec 2011 Link to this post

    I'm writing to ask how best to apply text to the RadToolBarDropDown programmatically, in C#;

    Thanks in advance for any insight;  Best regards - Rob

    <telerik:RadToolBar ID="RadToolBar3" runat="server" Skin="Black"  
                       BorderWidth="0px" onbuttonclick="RadToolBar3_ButtonClick">
                     <Items>
                         <telerik:RadToolBarDropDown runat="server" Font-Size="Medium">
                             <Buttons>
                                 <telerik:RadToolBarButton runat="server" Text="Sign Out" Font-Size="Medium" CheckOnClick="true" CommandName="SignOut">
                                 </telerik:RadToolBarButton>
                                 <telerik:RadToolBarButton runat="server" Text="Contact Us" Font-Size="Medium" CheckOnClick="true" CommandName="ContactUs">
                                 </telerik:RadToolBarButton>
                             </Buttons>
                         </telerik:RadToolBarDropDown>
                     </Items>
       </telerik:RadToolBar>
  2. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 06 Dec 2011 Link to this post

    Hello Robert,

    Try the following code snippet.
    C#:
    protected void Page_Load(object sender, EventArgs e)
    {
      RadToolBarDropDown dropDown = new RadToolBarDropDown();
      dropDown.Text = "DropDown1";
      dropDown.Buttons.Add(new RadToolBarButton("Text"));
      RadToolBar3.Items.Add(dropDown);
    }

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