G
Guest
I have a DataGrid on the left and TextBoxes (TB) on the right. The TB's
reflect the contents of the grid cells.
Sorting of columns (both thru VS and programmatically) work fine except,
when the form/grid first opens up and the grid is immediately sorted the TB
don't reflect the sorted data of the First row of the grid.
Note: Initially the black grid indicator arrow points to the first row. If
the user choses another row and then sorts the TB's reflect proper data.
//setGridSort(DataSet dataSet, DataGrid dataGrid, string
sortTableColumnName, int tableNo)
DataView dataView = createNewDataView();
dataView = dataSet.Tables[tableNo].DefaultView;
dataView.Sort = sortTableColumnName;
dataGrid.DataSource = dataView;
//incorrect - not the correct cell value of the grid for the TB
numberTB.Text = (string) (dataGrid[dataGrid.CurrentRowIndex, columnNo]);
Steve
reflect the contents of the grid cells.
Sorting of columns (both thru VS and programmatically) work fine except,
when the form/grid first opens up and the grid is immediately sorted the TB
don't reflect the sorted data of the First row of the grid.
Note: Initially the black grid indicator arrow points to the first row. If
the user choses another row and then sorts the TB's reflect proper data.
//setGridSort(DataSet dataSet, DataGrid dataGrid, string
sortTableColumnName, int tableNo)
DataView dataView = createNewDataView();
dataView = dataSet.Tables[tableNo].DefaultView;
dataView.Sort = sortTableColumnName;
dataGrid.DataSource = dataView;
//incorrect - not the correct cell value of the grid for the TB
numberTB.Text = (string) (dataGrid[dataGrid.CurrentRowIndex, columnNo]);
Steve