1

When my app starts, there is a ListView populated with data. How do I set it so that the first row is not selected automatically? Ie I don't want any items to be selected until the user clicks one

I have tried:

  • setting the property bound to the ListView's SelectedItem to null (the property is bound two-way),
  • setting the FallBackValue of the SelectedItem to null

but neither of these worked. Is there a way to do this, or am i stuck with the first item being selected when the app starts?

mcalex
  • 6,628
  • 5
  • 50
  • 80

1 Answers1

0

If you dont put SelectedItem or SelectedIndex it is not selecting anithing, but you want to set than try this code:

<ListView IsSynchronizedWithCurrentItem="True">
        <ListViewItem>Some text1</ListViewItem>
        <ListViewItem>Some text1</ListViewItem>
        <ListViewItem>Some text1</ListViewItem>
        <ListViewItem>Some text1</ListViewItem>
    </ListView>
Jamaxack
  • 2,400
  • 2
  • 24
  • 42
  • It seems you are right about it not selecting anything. I had 'IsSynchronizedWithCurrentItem="True"' which looks like it was causing the problem. When I removed that, it works. – mcalex Dec 17 '14 at 08:51