4

I want to scroll into selected item in a list box .for that now I am using one line of code in Listbox1_SelectionChanged event, but scroll is not working. I tried the same in a button click that is working fine .

Listbox1.ScrollIntoView(Listbox1.Items[Listbox1.SelectedIndex]);
Soner Gönül
  • 97,193
  • 102
  • 206
  • 364
achukrishnan
  • 875
  • 2
  • 8
  • 21

1 Answers1

0

I used in my solution first updated UI and the called ScrollIntoView it works fine:

follow this link for more info

Listbox1.UpdateLayout();
Listbox1.ScrollIntoView(Listbox1.Items[Listbox1.SelectedIndex]);
Pradeep Kesharwani
  • 1,480
  • 1
  • 12
  • 21