private void UpdateChassisButton_OnClick(object sender, RoutedEventArgs e) { IList selectedChassis = ChassisDataGrid.SelectedItems; int chassisSize = selectedChassis.Count; for (var i = 0; i < chassisSize; i++) { DataRowView row = (DataRowView)ChassisDataGrid.SelectedItems[i]; string textId = row["Id"].ToString(); int id = Convert.ToInt32(textId); Sasiu chassis = _client.FindChassisById(id); chassis.CodSasiu = row["CodSasiu"].ToString(); chassis.Denumire = row["Denumire"].ToString(); _client.UpdateChassis(chassis); } ChassisTabItem_OnLoaded(sender, e); }