Hi,
I have some RadListbox inside a ScrollViewer and I would like to be able to scroll with the mouse wheel anywhere inside the scrollviewer.
I'm aware that the RadListBox has a ScrollViewer in his template that capture the MouseWheelEvent so I changed the template by the following.
<Style x:Key="UnscrollableRadListBoxStyle" TargetType="telerik:RadListBox" BasedOn="{StaticResource RadListBoxStyle}">
<Setter Property="telerik:ScrollingSettingsBehavior.IsEnabled" Value="False"/>
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Disabled"/>
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="telerik:RadListBox">
<Grid>
<Border Padding="{TemplateBinding Padding}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
Margin="0"
BorderThickness="{TemplateBinding BorderThickness}">
<Border.InputBindings>
<KeyBinding Command="telerik:ListControl.SelectAllCommand" Key="A" Modifiers="Control"/>
</Border.InputBindings>
<ItemsPresenter/>
</Border>
<ContentPresenter x:Name="PART_DropVisualPlaceholder" Visibility="Collapsed" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
Now, the scroll works great, I can scroll with the mouse wheel everywhere. The problem is that when I drop an item inside one of the RadListBox, the DropVisualPlaceHolder appear at wrong place.
Do you have any idea of what I've done wrong ?
Thank you,
Etienne
I have some RadListbox inside a ScrollViewer and I would like to be able to scroll with the mouse wheel anywhere inside the scrollviewer.
I'm aware that the RadListBox has a ScrollViewer in his template that capture the MouseWheelEvent so I changed the template by the following.
<Style x:Key="UnscrollableRadListBoxStyle" TargetType="telerik:RadListBox" BasedOn="{StaticResource RadListBoxStyle}">
<Setter Property="telerik:ScrollingSettingsBehavior.IsEnabled" Value="False"/>
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Disabled"/>
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="telerik:RadListBox">
<Grid>
<Border Padding="{TemplateBinding Padding}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
Margin="0"
BorderThickness="{TemplateBinding BorderThickness}">
<Border.InputBindings>
<KeyBinding Command="telerik:ListControl.SelectAllCommand" Key="A" Modifiers="Control"/>
</Border.InputBindings>
<ItemsPresenter/>
</Border>
<ContentPresenter x:Name="PART_DropVisualPlaceholder" Visibility="Collapsed" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
Now, the scroll works great, I can scroll with the mouse wheel everywhere. The problem is that when I drop an item inside one of the RadListBox, the DropVisualPlaceHolder appear at wrong place.
Do you have any idea of what I've done wrong ?
Thank you,
Etienne