wpf 双击行。。获得行信息
void mydataGird_MouseDoubleClick(object sender, MouseButtonEventArgs e) { Point aP = e.GetPosition(mydataGird); IInputElement obj = mydataGird.InputHitTest(aP); DependencyObject target = obj as DependencyObject; int i = 0; while (target != null) { if (target is DataGridRow) { DataGridRow aDGR = target as DataGridRow; var item = aDGR.Item; break; } target = VisualTreeHelper.GetParent(target); i++; } }