ok here is my initial problem.
I populated a grid with a datatable (from a stored proc that is using 2 tables and pivots them) and when a user makes a change to a cell value the backend tables gets updated by running a transaction, so all the rows are recalculated. However, if I rebind the grid to the original datatable the grid gets redrawn. I cannot have this happen, so I decided to through in a middle datatable, since the only way to update the grid without redrawing it is do update the row object from the initial datatable. My question is, does anyone know how I can easily updated the initial datatable with the values from the new one, the rows never get added or deleted, so it is strictly an updated. Here is my code thus far,
I populated a grid with a datatable (from a stored proc that is using 2 tables and pivots them) and when a user makes a change to a cell value the backend tables gets updated by running a transaction, so all the rows are recalculated. However, if I rebind the grid to the original datatable the grid gets redrawn. I cannot have this happen, so I decided to through in a middle datatable, since the only way to update the grid without redrawing it is do update the row object from the initial datatable. My question is, does anyone know how I can easily updated the initial datatable with the values from the new one, the rows never get added or deleted, so it is strictly an updated. Here is my code thus far,
Code:
public void UpdateDataTable()
{
// Get the data table that will be modified.
DataTable population = dtPopulation;
//New Datatable with new values updated from the database
DataTable dtUpdated = LoadPopInGrid(IftProperties.IFTNo, IftProperties.Version, "PopIn_Pivot");
//Set Primary Key (same primary key I set on the dtPopulation datatable
DataColumn[] colPk = new DataColumn[2];
colPk[0] = dtUpdated.Columns["EpiSort"];
colPk[1] = dtUpdated.Columns["ctOrder"];
dtUpdated.PrimaryKey = colPk;
// Need to Update the Orginal Datatable
// Refresh grid, this does not collapse or redraw grid
this.ultraGrid1.Rows.Refresh(RefreshRow.ReloadData);
}