I need to charge the value of the element from the dataGrid when clicked by the user, in datarowview, to take the first value of "IdEmployee" and assign it to a variable.
This is my method, the problem in my dataRowView variable is Null!
How can i fix this?
private void _employeedataGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e)
{
DataRowView dataRowView = _employeedataGrid.CurrentCell.Item as DataRowView;
var idEmployee = Convert.ToInt32(dataRowView.Row[0]);
.......
}
source
share