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

Automatic width of RadRibbonBar

1 Answer 84 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
WolveFred
Top achievements
Rank 1
WolveFred asked on 30 Dec 2011, 04:50 PM
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

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 02 Jan 2012, 05:49 AM
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.
Tags
RibbonBar
Asked by
WolveFred
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or