wpf listview selecteditem 报错是因为搞了个itemssource!
2010-10-13 15:05
344 查看
nnd,调了半天,原来绑了个itemssource.
private void listView1_MouseUp(object sender, MouseButtonEventArgs e) { try { ListViewItem lvi = new ListViewItem(); MessageBox.Show(MainWindow.lv.SelectedItem.ToString());//lv是源。 lvi = (ListViewItem)MainWindow.lv.SelectedItem; MessageBox.Show(lvi.Content.ToString()); WrapPanel wp = (WrapPanel)lvi.Content; MessageBox.Show(wp.Children.Count.ToString()); Label lbpoint = (Label)wp.Children[1]; } catch (Exception ee) {MessageBox.Show(ee.ToString()); } }
相关文章推荐
- 将二维字符串数组作为WPF ListView的ItemSource
- WPF —ListView用ItemsSource绑定对象列表
- wpf listview的数据绑定(dataset)与selectedItem的数据
- [转载]Enum Binding ItemsSource In WPF
- WPF的DataGrid绑定ItemsSource后第一次加载数据有个别列移位的解决办法
- WPF Snippet Tutorial - Aligning ListView Items
- 【UWP】FlipView绑定ItemsSource,Selectedindex的问题
- WPF:改变ListBoxItem和ListViewItem的颜色
- WPF Datagrid.SelectedItem的用法实践
- WPF:改变ListBoxItem和ListViewItem的颜色
- 解答WPF中ComboBox SelectedItem Binding不上的Bug
- WPF数据绑定——Datacontext和itemsource的区别
- [WPF]解决ListView在没有Items时,水平滚动条不出现的问题
- 使用DataContext和ItemsSource将数据源绑定到ListView上的区别
- 求助 WPF ListViewItem样式问题
- DevExpress WPF入门指南:跟随 Items Source 向导完成数据绑定
- WPF应用Binding之ItemsSource
- WPF standard ComboBox Items Source Change Issue
- Wpf ItemsSource排序
- WPF学习笔记——ListBox用ItemsSource绑定数据源