/// <summary> /// Updates the given grid row using the corresponding resource item of the given resource set /// </summary> private void UpdateGridRowFromResourceItem(DataGridViewRow row, ResourceSet resourceSet) { string rowKey = row.Cells[ColumnNames.Key].Value.ToString(); // if given resource set does not contain resource item for the row // then put all values to null if (!resourceSet.ContainsKey(rowKey)) { row.Cells[ColumnNames.LocalValue].Value = null; row.Cells[ColumnNames.LocalComment].Value = null; RowSetStatus(row, null); } else { ResourceItem resourceItem = resourceSet[rowKey]; row.Cells[ColumnNames.LocalValue].Value = resourceItem.Value; row.Cells[ColumnNames.LocalComment].Value = resourceItem.Comment; RowSetStatus(row, resourceItem); } row.Height = row.GetPreferredHeight(row.Index, DataGridViewAutoSizeRowMode.AllCells, true); }