Make no item selected in windows phone toolkit list picker

后端 未结 2 1384
抹茶落季
抹茶落季 2020-12-21 10:33

I\'m using the ListPicker control from the WP7 Toolkit. I want to initially present the list with no items selected. Is there a way of doing this?

相关标签:
2条回答
  • 2020-12-21 11:03

    By design ListPicker must have a selected item. If you try to set it to null or set the SelectedIndex to -1 you will get an exception.

    0 讨论(0)
  • 2020-12-21 11:24

    According to this blog entry List Picker works with the idea of "there is always an active selection".

    The approach I would follow is to have the first item in the list be you "no selected item" item. With appropriate values (maybe a null id) that you can identify later on.

    0 讨论(0)
提交回复
热议问题