Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当用户右键单击它时,我想获取数据网格的数据网格行吗?
要获得选定的行,您需要添加 SelectionChange 事件
private void dataGrid1_SelectionChanged(object sender, SelectionChangedEventArgs e) { var rowview = dataGrid1.SelectedItem ; if (rowview != null) { //your code } }