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

Limit the height of the drop down menu

4 Answers 97 Views
BreadCrumb
This is a migrated thread and some comments may be shown as answers.
Alfonso
Top achievements
Rank 1
Alfonso asked on 23 Aug 2011, 06:39 PM
Hi,
I'm working with a RadBreadcrumb control that's populated with a lot of items. The control lets you navigate by mouse or by typing in the text box. When you type in the box, an autocomplete scrolling list drops down. When you navigate by clicking the arrows in the control, the drop down list takes up the height of the page, and it does not have scrollbars.

Is there a way to limit the size of the drop down menu and the autocomplete menu?

Thanks in advance!

4 Answers, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 26 Aug 2011, 04:17 PM
Hello Alfonso,

 You can edit the default Style of RadBreadCrumb and play with the Width/Height of the "historySplitButton" RadSplitButton and "AutoCompleteListBox" ListBox from the Template. You can view the Style extracted from Blend in the attached sample. Please let us know if you need further assistance.

Greetings,
Petar Mladenov
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Alfonso
Top achievements
Rank 1
answered on 26 Aug 2011, 08:12 PM
Thanks Petar, it worked, but I also need to limit the height context menu that appears when you click on an arrow in the breadcrumb bar. I couldn't find the context menu in the template.
You can add these lines at the end of the MainPageViewModel.LoadItems() to see how my scenario looks like:
for (int i = 0; i < 1000; i++)            
{
    Root.Children.Insert(0, new ExplorerItem() { Header = "Test" });
}
0
Zarko
Telerik team
answered on 31 Aug 2011, 03:38 PM
Hello Alfonso,
If you want to set a max dropdown size to the RadSplitButtons inside the RadBreadcrumb you'll just have to set the SplitButtonStyle property of the RadBreadcrumb with something like this:
<Style TargetType="telerik:RadSplitButton">
    <Setter Property="IsTabStop" Value="false" />
    <Setter Property="IsOpen" Value="false" />
    <Setter Property="BorderThickness" Value="1" />
    <Setter Property="BorderBrush" Value="Transparent" />
    <Setter Property="Background" Value="Transparent" />
    <Setter Property="DropDownMaxHeight" Value="400" />
    <Setter Property="HorizontalContentAlignment" Value="Center" />
    <Setter Property="VerticalContentAlignment" Value="Center" />
    <Setter Property="Padding" Value="3" />
    <Setter Property="TogglePartStyle" Value="{StaticResource toggleStyle}" />
</Style>
But if you really plan to have like a thousand items in the DropDown part you may want to use an ItemsPresenter that support virtualization for better performance.
For further references could you please examine the attached project and if you have more questions feel free to ask. 

All the best,
Zarko
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Alfonso
Top achievements
Rank 1
answered on 08 Sep 2011, 04:47 PM
It worked great.
Thanks for your help!
Tags
BreadCrumb
Asked by
Alfonso
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Alfonso
Top achievements
Rank 1
Zarko
Telerik team
Share this question
or