WPF: How to get a selected row value from Datagrid on double click

Posted on Posted in C#, WPF

A very simple of  getting a selected row value from Datagrid on double click…

1) Create a double click event on WPF form/window

private void uxABC_MouseDoubleClick(object sender, MouseButtonEventArgs e){

myData decData = uxABC.SelectedItem as MyData;

Guid myId = decData.MyId;

}

2) Then get the selected index and cast it as your type of object if you have it otherwise you can just debug and figure out

3)We can then use selected cell value where we need to