您的位置:首页 > 其它

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()); }
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: