wpf datagrid question

Aug 10, 2009 at 4:08 PM
Edited Aug 11, 2009 at 8: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)[0];
DataRowView drv = (DataRowView)dataGrid1.CurrentItem;
drv.Row["Department_ID"] = dr.ItemArray[2];
drv.Row["Department_Name"] = dataSet.Tables["Department"].Select("Department_ID=" + dr.ItemArray[2])[0].ItemArray[1];

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?