Problem with custom FilteringControl and scroll wheel

4 posts, 0 answers
  1. Håkan
    Håkan avatar
    183 posts
    Member since:
    May 2011

    Posted 16 Apr 2014 Link to this post

    I have a custom filtering control with a strange behavior using the mouse scroll wheel.
    If I use the theme property on the distinct values ListBox (OfficeBlack theme) one tick on the mouse wheel will scroll down half way in the list and one more tick will scroll all the way down. But the list contains 300 records!

    If I remove the theme property I will have to spin the wheel several times before it even starts to scroll my list.
    But when it actually starts to scroll it scrolls the list fine, not all the way down at once.
    The amount of time I have to scroll seems to be related to the number of rows in the data grid behind, so it seems it is scrolling the grid first (but invisible) then when it reaches bottom of grid, the filter list will start to scroll.

    Here is my template for the filtering control:
    <ControlTemplate x:Key="FilteringControlTemplate" TargetType="telerik:FilteringControl">
        <Border BorderThickness="{TemplateBinding BorderThickness}" Margin="{TemplateBinding Margin}" CornerRadius="1" BorderBrush="{TemplateBinding BorderBrush}">
            <Border BorderBrush="{StaticResource ControlInnerBorder}" BorderThickness="1" Background="{TemplateBinding Background}">
                <Grid>
                    <StackPanel x:Name="PART_DistinctFilterPanel" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Loaded="PART_DistinctFilterPanel_Loaded">
                        <StackPanel x:Name="PART_DistinctFilter" Visibility="{TemplateBinding DistinctFiltersVisibility}">
                            <CheckBox x:Name="PART_SelectAllCheckBox" IsChecked="{Binding SelectAll, Mode=TwoWay}" Margin="5,2,5,2" telerik:LocalizationManager.ResourceKey="GridViewFilterSelectAll" />
                            <ListBox x:Name="PART_DistinctValuesList" telerik:StyleManager.Theme="{StaticResource Theme}" ItemsSource="{Binding DistinctValues}" ScrollViewer.HorizontalScrollBarVisibility="Auto" SelectionMode="Multiple" MaxHeight="500" Loaded="PART_DistinctValuesList_Loaded">
                                <ListBox.ItemsPanel>
                                    <ItemsPanelTemplate>
                                        <VirtualizingStackPanel />
                                    </ItemsPanelTemplate>
                                </ListBox.ItemsPanel>
                                <ListBox.ItemTemplate>
                                    <DataTemplate>
                                        <CheckBox IsChecked="{Binding IsActive, Mode=TwoWay}" Content="{Binding ConvertedValue, Converter={StaticResource DistinctValueConverter}}" VerticalContentAlignment="Center" Margin="0,0,0,0" />
                                    </DataTemplate>
                                </ListBox.ItemTemplate>
                            </ListBox>
                        </StackPanel>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition />
                                <ColumnDefinition />
                            </Grid.ColumnDefinitions>
                            <Button x:Name="PART_ApplyFilterButton" Grid.Column="0" Style="{StaticResource DefaultButton}" Margin="8,14,5,8" Height="22" Visibility="{TemplateBinding FilterButtonVisibility}" telerik:LocalizationManager.ResourceKey="GridViewFilter" Loaded="PART_ApplyFilterButton_Loaded" />
                            <Button x:Name="PART_ClearFilterButton" Grid.Column="1" Style="{StaticResource DefaultButton}" Margin="5,14,8,8" Height="22" telerik:LocalizationManager.ResourceKey="GridViewClearFilter" Loaded="PART_ClearFilterButton_Loaded" />
                        </Grid>
                    </StackPanel>
                    <telerik:RadButton x:Name="PART_FilterCloseButton" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="{TemplateBinding Padding}" Height="15" Width="15">
                        <Path Data="M4,4L5,4 5,5 4,5z M0,4L1,4 1,5 0,5z M3,3L4,3 4,4 3,4z M1,3L2,3 2,4 1,4z M2,2L3,2 3,3 2,3z M4,0L5,0 5,1 4,1 4,2 3,2 3,0.99999994 4,0.99999994z M0,0L1,0 1,0.99999994 2,0.99999994 2,2 1,2 1,1 0,1z" Fill="{StaticResource TextBrush}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Height="6" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Width="6" />
                    </telerik:RadButton>
                </Grid>
            </Border>
        </Border>
    </ControlTemplate>

    When I don't use a custom filtering control the behavior is almost the same, it will scroll all the way down in one tick on the wheel and when at the bottom of the list, the grid behind will start to scroll, even though the mouse is still over the filtering control.

    I'm using the last Silverlight 4 version, is this something that is fixed later or have I done something wrong?

    Regards,
    Håkan

  2. Ivan Ivanov
    Admin
    Ivan Ivanov avatar
    1127 posts

    Posted 18 Apr 2014 Link to this post

    Hi,

    I have prepared a very simple dummy project that illustrates comparison between a themed and not-themed ListBox and I do not see any difference in scrolling behavior. However, I have used one of the latest versions with Silverlight 5, as we do not support Silverlight since Q2 SP 2012. I am attaching the project for your reference. Can you please share which version you are currently using, so that we can check this.

    Regards,
    Ivan Ivanov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. DevCraft banner
  4. Håkan
    Håkan avatar
    183 posts
    Member since:
    May 2011

    Posted 10 Nov 2014 in reply to Ivan Ivanov Link to this post

    Hi there!

    Been a while since you answeded this but it kinda stalled for me back then.
    Now this problem has surfaced again.

    There is no problem for me scrolling a normal ListBox as you did in your example.
    The problem is within a custom FilteringControl as my example showed.

    Can you please verify this.

    Regards,
    Håkan
  5. Ivan Ivanov
    Admin
    Ivan Ivanov avatar
    1127 posts

    Posted 13 Nov 2014 Link to this post

    Hi,

    Can you please send us a runnable sample project that uses your custom filtering control, so that we can debug it on our side and give you an appropriate solution? 

    Regards,
    Ivan Ivanov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top