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 } }
As an exercise, I am creating a list of Books as a LinkedList and using the Comparator interface to sort them by author or title. First, I create a class of books and ensure that it will print to screen the way I want it