如何防止自动选择数据绑定上的GridView中的第一项? [英] how to prevent autoselection of first item in GridView on databind?
本文介绍了如何防止自动选择数据绑定上的GridView中的第一项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
SelectionMode
属性被设置为 multiple
。有什么办法可以防止这种自动选择?或者我应该听什么事件以便我可以将GridView的 SelectedIndex
重置为-1? 在xaml的gridview中 When I databind my GridView to an ObservableCollection, the first item of the collection is automatically selected. The SelectionMode
property of the GridView is set to multiple
. Is there some way to prevent this auto-selection? Or on what event should I listen so that I can reset the SelectedIndex
of the GridView back to -1?
解决方案
Set the IsSynchronizedWithCurrenItem
property to false
on the gridview in xaml
这篇关于如何防止自动选择数据绑定上的GridView中的第一项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文