Limit the height of the drop down menu

5 posts, 0 answers
  1. Alfonso
    Alfonso avatar
    3 posts
    Member since:
    Jun 2011

    Posted 23 Aug 2011 Link to this post

    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!
  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 26 Aug 2011 Link to this post

    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 >>

  3. DevCraft banner
  4. Alfonso
    Alfonso avatar
    3 posts
    Member since:
    Jun 2011

    Posted 26 Aug 2011 Link to this post

    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" });
    }
  5. Zarko
    Admin
    Zarko avatar
    755 posts

    Posted 31 Aug 2011 Link to this post

    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 >>

  6. Alfonso
    Alfonso avatar
    3 posts
    Member since:
    Jun 2011

    Posted 08 Sep 2011 Link to this post

    It worked great.
    Thanks for your help!
Back to Top
DevCraft banner