.Net CF SP2 ListviewItem.Select bug (?)

  • Thread starter Thread starter JO
  • Start date Start date
J

JO

In .NetCF SP2, I have some code that does this:

(in keypress event handler)
if (key == Keys.Down && listView.SelectedIndices[0] ==
listView.Items.Count - 1)
{
listView.Items[0].Selected = true;
}

My goal is to have the selection scroll to the top if a user hits down from
the last entry.

It doesn't seem to work - the index 0 gets selected, but I can't continue
moving down to index 1 afterwards. If I hit up, I goto index
listView.Items.Count - 2! So it looks like internally, the pointer to the
currently selected item isn't being set.

How would I fix this? Am I using the right field?
 
Back
Top