I Used mytoolkit.extended controls for datagrid, there is datagrid and inside it there is MtListbox. I have set vertical scroll bar to auto, it is working fine but i need an option that whenever scroll bar appears it should go down and show the last item.
Asked
Active
Viewed 914 times
1 Answers
2
ScrollViewer
has a property which indicates the vertical size of the area which can be scrolled inside it, called ScrollableHeight
.
To alter the offset position within the ScrollViewer
, you should utilize the ChangeView
method, which causes the ScrollViewer
to load a new View based on the offsets and zoom factor specified.
public bool ChangeView(Nullable horizontalOffset, Nullable verticalOffset, Nullable zoomFactor)
Now you can simply utilize it like this:
myScrollViewer.ChangeView(null, myScrollViewer.ScrollableHeight, null);
You will want to make sure that this executes on the UI thread, and to do so you can dispatch the work to the UI thread:
await Windows.ApplicationModel.Core.CoreApplication.MainView.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
{
myScrollViewer.ChangeView(null, myScrollViewer.ScrollableHeight, null);
});

André B
- 1,699
- 2
- 11
- 22