I have a hand built dataset where some columns come from a sql database and others are calculated and eventually I will have two different query results going into one table because its impossible for me to get all the data w/one query.
The problem I need help with is getting the DataGrid to reflect changes from a sort.
The foundRows DataRow array contains correctly sorted rows (verified), but I can't get the table updated in the DataGrid. I think my problem has to do with ViewState but I'm not sure. How would I update DataGrid from the sort results?
The problem I need help with is getting the DataGrid to reflect changes from a sort.
The foundRows DataRow array contains correctly sorted rows (verified), but I can't get the table updated in the DataGrid. I think my problem has to do with ViewState but I'm not sure. How would I update DataGrid from the sort results?
Code:
void dgridResults_SortCommand(object source, DataGridSortCommandEventArgs e)
{
collectionId = int.Parse(HttpUtility.UrlDecode(Request.QueryString["collectionId"]));
dsBuilder.GetResultsDataSet(dsResults, collectionId);
DataRow[] foundRows = dsResults.Tables["ResultTable"].Select("JobId > 0", "JobId ASC");
for (int index = 0; index < foundRows.Length; index++)
{
dsResults.Tables[RESULT_TABLE].Rows[index].BeginEdit();
dsResults.Tables[RESULT_TABLE].Rows[index].ItemArray = foundRows[index].ItemArray;
dsResults.Tables[RESULT_TABLE].Rows[index].EndEdit();
dsResults.Tables[RESULT_TABLE].Rows[index].AcceptChanges();
}
dgridResults.DataSource = dsResults;
dgridResults.DataBind();
}
Comment