Programmatically Scroll Silverlight ListBox
Posted
by Ricky Supit
on Stack Overflow
See other posts from Stack Overflow
or by Ricky Supit
Published on 2010-04-01T20:34:50Z
Indexed on
2010/04/02
13:23 UTC
Read the original article
Hit count: 1107
I tried using the following method, but it doesn't seem to work on databound listbox.
mylistbox.ScrollIntoView(mylistbox.Items[mylistbox.Items.Count - 1])
I also tried to grab the IScrollProvider with no success:
var lbItemAutomation = (ListBoxAutomationPeer)ListBoxAutomationPeer.CreatePeerForElement(mylistbox);
var listBoxScroller = (IScrollProvider)lbItemAutomation.GetPattern(PatternInterface.Scroll); <-- returns null value
Thanks, Ricky
UPDATE 4/1: After retried, I confirm the first method works. However, It will be nice the get the second method works since you can scroll by percentage through this method. So any help will be appreciated.
© Stack Overflow or respective owner