private void DGMaterials_MouseDoubleClick(object sender, MouseButtonEventArgs e)
{
DataGrid grid = sender as DataGrid;
if (grid != null && grid.SelectedItems != null && grid.SelectedItems.Count == 1)
{
DataGridRow dgr = grid.ItemContainerGenerator.ContainerFromItem(grid.SelectedItem) as DataGridRow;
DataRowView row = (DataRowView)dgr.Item;
MessageBox.Show(" ID: " + row["Id"]);
}
}