WPF DataGrid : CanContentScroll property causing odd behavior
- by Sonic Soul
i have a solution where i generate a DataGrid (or multiple instances) based on user criteria.. each grid keeps receiving data as it comes in via ObservableCollection
the problem i had, was that the scroll acted weird. It was choppy, and scrollbar would resize it self while scrolling.
than i found.. CanContentScroll property! It completely fixes the weird scrolling behavior bringing me temporary bliss and happiness.
however, it causes 2 unfortunate side effects.
whenever i re-create grid instances and bind them to my observable collection, it freezes my entire window for 5 seconds. when my grid grows to a big size, this delay can last for 30 seconds.
when i call TradeGrid.ScrollIntoView(TradeGrid.Items(TradeGrid.Items.Count - 1)) to scroll to the bottom, it jumps to bottom and than back to the top.
is there another way to achieve smooth scrolling perhaps?