Aug 10, 2009 at 3:08 PM
Edited Aug 11, 2009 at 7:43 AM
Hello! Sorry for my English.
I have a DataGrid, first column of which is DataGridComboBoxColumn, the rest are DataGridTextColumns. The DataGrid
is bound to a DataSet. ComboBoxColumn is bound to one of its table. When I select some item from the ComboBoxColumn,
content of other cells (in the same row) is changed from code-behind:
ComboBox cb = (ComboBox)e.OriginalSource;
int disciplineID = (Int32)cb.SelectedValue;
DataRow dr = dataSet.Tables["Discipline"].Select("Discipline_ID=" + disciplineID);
DataRowView drv = (DataRowView)dataGrid1.CurrentItem;
drv.Row["Department_ID"] = dr.ItemArray;
drv.Row["Department_Name"] = dataSet.Tables["Department"].Select("Department_ID=" + dr.ItemArray).ItemArray;
The problem: the cells are still empty though their values were changed. But their content display correctly When I
double-click on these cells and enter in the edit mode. After that clicked cells will work right - their
content remains visible and changing in accordance with the item selected in the ComboBox of ComboBoxColumn.
Can somebody help me to solve this problem?