Automatic width of RadRibbonBar

2 posts, 0 answers
  1. WolveFred
    WolveFred avatar
    4 posts
    Member since:
    Sep 2011

    Posted 30 Dec 2011 Link to this post

    Hi !

    I would like to create a RibbonBar dynamically, so I don't know the required width in advance.

    Is it possible to set an automatic width for the RadRibbonBar and how ?

    Fred
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 01 Jan 2012 Link to this post

    Hello,

    Try the following code snippet and set automatic width by CSS as shown.
    CS:
    protected void Page_Load(object sender, EventArgs e)
       {
           RadRibbonBar rbnbr = new RadRibbonBar();
           rbnbr.ID = "RadRibbonBar1";
           RibbonBarTab tb = new RibbonBarTab();
           tb.Text = "Home";
           rbnbr.Tabs.Add(tb);
           rbnbr.CssClass = "abc";
           form1.Controls.Add(rbnbr);
       }
    CSS:
    <style type="text/css">
       .abc
        {
          background:Red !important;
          width:auto !important;
        }
    </style>

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top