I am using the RadGridView to display system events. As new events are observed they are added to the grid's data context. After the data context grows to a particular number of items the oldest items begin to be removed as new items are added. This creates a constantly scrolling view of the items after it reaches maximum size. The number of events occurring in the system make this view unreadable. To correct this problem the visible rows of the grid should be fixed if the scroll bar is not at position zero. Any suggestion on how I could accomplish this would be appreciated.
Thanks,
Matt
5 Answers, 1 is accepted
Maybe you can use ScrollIntoView/ScrollIntoViewAsync to make sure desired data item is in view.
Greetings,Vlad
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
I have looked into ScrollIntoView/ScrollIntoViewAsync however I cannot identify a good way to determine which item to use as an argument. Does functionality exist to identify which rows are visible or the scroll index?
In addition should this call be prompted by an event on the data context or the grid?
Thanks,
Matt
I've tried to replicate your scenario and indeed it is very hard to know which item you should force into view since the item can be removed. Maybe it will be better in your case to avoid scrolling at all and use for example paging instead (I've attached small demo project demonstrating this).
Kind regards,Vlad
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
I'm afraid changing control template will not help in this case. This is just the behavior of the standard ScrollViewer (you can try other standard WPF components) when the extent height is changing rapidly.
Regards,Vlad
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.