BUG: Scroll issues with grouping in Office 2013 theme

4 posts, 0 answers
  1. Maurice
    Maurice avatar
    8 posts
    Member since:
    Feb 2014

    Posted 27 Jul Link to this post

    When adding grouping, I am experience some strange jumping behavior when the mouse is moved around the scrollview area. Also random amounts of white space are added to the bottom part of the scrollview area.

    Changing theme to another will resolve the issue, although I have not tested all themes for complete per theme repro. If you can provide me means to send you a repro project, I have one ready.

     

    Regards,
    Maurice

     

     

  2. Maurice
    Maurice avatar
    8 posts
    Member since:
    Feb 2014

    Posted 27 Jul in reply to Maurice Link to this post

    Rather than upload a project, the code is listed below

    <Window x:Class="TelerikWpfApp1.MainWindow"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                    xmlns:local="clr-namespace:TelerikWpfApp1"
                    Title="MainWindow" Height="350" Width="525">
     
      <Window.DataContext>
        <local:MainWindowViewModel />
      </Window.DataContext>
     
      <StackPanel Margin="100">
        <telerik:RadComboBox ItemsSource="{Binding StatusList}" Margin="0" Grid.Row="1" DisplayMemberPath="Name" SelectedValue="{Binding SelectedStatus}" SelectedValuePath="Id">
          <telerik:RadComboBox.GroupStyle>
            <GroupStyle>
              <GroupStyle.HeaderTemplate>
                <DataTemplate>
                  <TextBlock Text="{Binding Name}" FontWeight="Bold" Margin="0,10,0,3" />
                </DataTemplate>
              </GroupStyle.HeaderTemplate>
            </GroupStyle>
          </telerik:RadComboBox.GroupStyle>
        </telerik:RadComboBox>
      </StackPanel>
    </Window>

     

    using System.Windows.Data;
    using Telerik.Windows.Controls;
     
    namespace TelerikWpfApp1
    {
      public class MainWindowViewModel : ViewModelBase
      {
        public ListCollectionView StatusList { get; }
     
     
        public MainWindowViewModel()
        {
          StatusList = new ListCollectionView(new[]
          {
            new ListItem { Name = "X", Value = 1, Group = "One"  },
            new ListItem { Name = "Y", Value = 0, Group = "One" },
            new ListItem { Name = "Z", Value = 2, Group = "One"  },
     
            new ListItem { Name = "A", Value = 1, Group = "Two"  },
            new ListItem { Name = "B", Value = 0, Group = "Two"  },
            new ListItem { Name = "C", Value = 2, Group = "Two"  },
     
            new ListItem { Name = "D", Value = 3, Group = "Three"  },
            new ListItem { Name = "E", Value = 2, Group = "Three"  },
            new ListItem { Name = "F", Value = 1, Group = "Three"  },
            new ListItem { Name = "G", Value = 0, Group = "Three"  },
     
            new ListItem { Name = "H", Value = 0, Group = "Four"  },
            new ListItem { Name = "I", Value = 0, Group = "Four"  }
          });
          StatusList.GroupDescriptions.Add(new PropertyGroupDescription(nameof(ListItem.Group)));
        }
      }
     
      public class ListItem
      {
        public string Name { get; set; }
     
        public object Value { get; set; }
     
        public string Group { get; set; }
      }
    }

    Regards,

    Maurice

  3. Kalin
    Admin
    Kalin avatar
    1279 posts

    Posted 28 Jul Link to this post

    Hi Maurice,

    This is happening because by default RadComboBox scrolls per item and when grouped each group is an item. So when if you mouse over partially visible group - the controls scrolls the whole group into view. I assume it is working differently in the different themes because of the different default sizes of the parts of the control (the ComboBoxItems, drop down height) in the themes. What I can suggest you as solution would be to try setting the ScrollViewer.CanContentScroll to False the control will stop auto scrolling the whole groups:
    <telerik:RadComboBox ItemsSource="{Binding StatusList}"
                            DisplayMemberPath="Name"
                            ScrollViewer.CanContentScroll="False"
                            SelectedValue="{Binding SelectedStatus}"
                            SelectedValuePath="Id">

    Hope this helps.

    Regards,
    Kalin
    Progress Telerik
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
  4. Maurice
    Maurice avatar
    8 posts
    Member since:
    Feb 2014

    Posted 28 Jul in reply to Kalin Link to this post

    Thank you for the resolution.

    Regards,
    Maurice

Back to Top