Scroll position

3 posts, 1 answers
  1. Test
    Test avatar
    2 posts
    Member since:
    May 2015

    Posted 06 May 2015 Link to this post

    Hi.
    When I open a combobox, selected item is scrolled somewhere in the bottom of dropdown area (Screenshot 1). I need to have selected item scrolled at the very top of  that area (Screenshot 2). Is this possible? How can I do that?

     Thank you.

     

    Tomas

  2. Answer
    Nasko
    Admin
    Nasko avatar
    585 posts

    Posted 08 May 2015 Link to this post

    Hi Tomas,

    What we could suggest you in order to achieve the desired behavior of RadComboBox's ScrollViewer is to get the control from the Template of the ComboBox control and scroll to the desired position as shown below:
    private void radComboBox_Loaded(object sender, RoutedEventArgs e)
    {
          varscrollViewerCombo = this.radComboBox.Template.FindName("PART_ScrollViewer", this.radComboBox) as ScrollViewer;
     
        //use the Scroll methods to scroll to the desired position
    }


    Hopes this helps.

    Regards,
    Nasko
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Test
    Test avatar
    2 posts
    Member since:
    May 2015

    Posted 13 May 2015 in reply to Nasko Link to this post

    Thanks Nasko.

    Good idea. I just had to handle DropDownOpened event instead of Loaded, because I need to scroll selected item to the top everytime drop down is opened. Seems it works fine now.

     

     Regards,

    Tomas

Back to Top