A lot of information on DataGridView , but I did not find information on DataGrid . How to handle a click on a row in a datagrid?
1 answer
Taken from here
You can use ItemContainerStyle
<DataGrid ... > <DataGrid.ItemContainerStyle> <Style TargetType="DataGridRow"> <EventSetter Event="MouseDoubleClick" Handler="Row_DoubleClick"/> </Style> </DataGrid.ItemContainerStyle> ... </DataGrid> Handler:
private void Row_DoubleClick(object sender, MouseButtonEventArgs e) { // execute some code } - just add among the columns in wpf and when you click on the line can we read? - Nikolay
- @Nikolay yes, but why not switch to using a DataGridView? - Yurii Manziuk
- I just think that technology should not be scary, it should be studied. Yes, and I would not like to use Windows.Forms - Nikolay
|
DataGridcarriage and a small cart , which one interests you? - Bulson