星空网 > 软件开发 > ASP.net

WPF DataGrid 鼠标双击选中的DataGridRow及Row数据

设置DataGrid的MouseDoubleClick事件

代码

//DataGrid鼠标双击事件Private void dataGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e) {   if(this.dataGrid.SelectedIndex == -1)   {     return;   }   DataGridRow row = (DataGridRow)dataGrid.ItemContainerGenerator.ContaineFormIndex(this.dataGrid.SelectedIndex); } 

这段代码有个缺点,就是只要鼠标双击DataGrid这个控件的任何位置都会触发这个事件而不是点击DataGridRow触发

望高手改正




原标题:WPF DataGrid 鼠标双击选中的DataGridRow及Row数据

关键词:wpf

wpf
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流