ListView FocusedItem Becomes NULL

Posted by Andy and Tyler on Stack Overflow See other posts from Stack Overflow or by Andy and Tyler
Published on 2008-11-10T03:15:21Z Indexed on 2010/03/18 22:21 UTC
Read the original article Hit count: 577

Filed under:
|
|
|

When the program runs, there is a series of ListView forms. We populated one of them with items (as strings) and we check whether the state of selection has changed. Once it's changed, we grab the text of the selected item using FocusedItem.Text. The first time works just fine but when another selection is made, the selected item returns as null.

The only way we can temporarily get around this issue is to clear and repopulate the form. The disadvantage is that we lose the highlighted item. There got to be another way around this. Maybe we're not clear on how ListView really works?

Any ideas?

© Stack Overflow or respective owner

Related posts about listview

Related posts about c#