W
Windows Central Question
ListView won't scroll using ScrollIntoView
For some reason, I cannot get the ScrollIntoView to work for my ListView. FYI... I have added my items to my ListView manually by adding ListViewItems that custom content set for each one. Not sure that that matters.
public void GoToBottom()
{
if (lv.Items != null)
{
if (lv.Items.Count > 0)
{
lv.SelectedIndex = lstSurvey.Items.Count - 1;
lv.UpdateLayout();
lv.ScrollIntoView(lstSurvey.Items[lv.SelectedIndex], ScrollIntoViewAlignment.Default);
}
}
}
For some reason, I cannot get the ScrollIntoView to work for my ListView. FYI... I have added my items to my ListView manually by adding ListViewItems that custom content set for each one. Not sure that that matters.
public void GoToBottom()
{
if (lv.Items != null)
{
if (lv.Items.Count > 0)
{
lv.SelectedIndex = lstSurvey.Items.Count - 1;
lv.UpdateLayout();
lv.ScrollIntoView(lstSurvey.Items[lv.SelectedIndex], ScrollIntoViewAlignment.Default);
}
}
}