I have a ListView in WPF, my problem is if an item is partially displayed and I click on item, the list will automatically scroll so the whole item will be visible.
How can I disable this Auto Scroll feature?
Thank you
had the same problem and i've found a sulotion :)
in the Xaml you define a style for the ListViewItem with this EventSetter:
<ListView.ItemContainerStyle>
<Style TargetType="{x:Type ListViewItem}">
<EventSetter Event="RequestBringIntoView" Handler="ProjectListView_OnRequestBringIntoView"/>
</Style>
</ListView.ItemContainerStyle>
in code behind:
private void ProjectListView_OnRequestBringIntoView(object sender, RequestBringIntoViewEventArgs e)
{
e.Handled = true;
}
Hope this will work for you too :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With