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

How to remove vertical scroll bar for RadToolBarSplitButton

3 Answers 111 Views
ToolBar
This is a migrated thread and some comments may be shown as answers.
Stephane
Top achievements
Rank 1
Stephane asked on 22 Nov 2011, 05:28 PM
Hi,
I have a RadToolBarSplitButton where I set buttons in runtime.
I calcule the dropdown height from the number of  button.

But everyime the vertical scroll bar are visible.

How do you remove this scroll bar ?

int dropDownHeight = (int)(Annees.Buttons.Count * 25);
if (dropDownHeight > 250)
{
   dropDownHeight = 250;
   //show vertical scroll bar
}
else
{
  //not show vertical scroll bar
}
                         
Annees.DropDownHeight = Unit.Pixel(dropDownHeight);

3 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 23 Nov 2011, 07:49 AM
Hello,

If you set the DropDownHeight property of RadToolBarSplitButton, then it automatically shows vertical scrollbar. Inorder to remove vertical scrollbar you can try the following CSS.

CSS:
<style type="text/css">
.RadToolBarDropDown_Default
  {
    overflow-y:hidden ! important;
  }
</style>
 
Thanks,
Princy.
0
Accepted
Kevin
Top achievements
Rank 2
answered on 23 Nov 2011, 02:08 PM
Hello Stephane,

I think the better solution is that you change your code to something like this:

int dropDownHeight = (int)(Annees.Buttons.Count * 25);
  
if (dropDownHeight > 250)
{   
    // set drop-down height, scroll bar is shown
    Annees.DropDownHeight = Unit.Pixel(250);  
}
else
{  
    // don't set drop-down height, no scroll bar will be shown
    Annees.DropDownHeight = Unit.Empty;
}

Princy's solution will hide the scrollbar even when you need it to be there.

I hope that helps.
0
Stephane
Top achievements
Rank 1
answered on 23 Nov 2011, 03:13 PM
Hi all,
thanks for your help Kevin and Princy.

It's ok for me.
Tags
ToolBar
Asked by
Stephane
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Kevin
Top achievements
Rank 2
Stephane
Top achievements
Rank 1
Share this question
or