开发者

Make no item selected in windows phone toolkit list picker

开发者 https://www.devze.com 2023-02-09 21:53 出处:网络
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?According to this blog entry List Pic

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?


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.


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

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号