Hi,
I have a grid binded to a datatable, with ViewStyleBand set to OutlookGroupBy. The datatable is updated by program instead of user edit. User is allowed to drag columns as groupby columns. If there is only one groupby column, the groupby rows remains its expanded state as previously when data is udpated to the datatable. However, when I drag another column as GroupBy column (added up to 2 groupby cols), all rows will be automatically collapsed whenever there is data update. Any idea? I'm using RereshSortPositiion instead of SortedColumns.RefreshSort.
I know that there was an issue that was resolved where GroupByRows were being collapsed when the data is being updated, so you might want to ensure you have the latest hotfix. You might want to make sure that nothing that you are doing, in terms of updating the grid's DataSource, is causing a Reset notification to be sent to the grid, since this will cause all the rows to be recreated. You could also have Developer Support check to see if this problem exists in the latest build, providing them with a small sample to reproduce the issue, if the most recent hotfix doesn't address the issue.
-Matt
Hi Matt,
Is there a way to know whether the grid has received a Reset Notification?
The DataTable has a primary key column (PK), and below is the code how it is updated. Will it cause the reset notification?
Thank you.
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
DataRow [ drResults = tblData.Select(string.Format("PK='{0}'", inData.ID));
DataRow drTargetRow = null;if (drResult != null && drResults.Length > 0) drTargetRow = drResults[0];else{ drTargetRow = tblData.NewRow(); drTargetRow["PK"] = inData.ID; tblData.Rows.Add(drTargetRow);}
//update other columns if there is changesfor(int i=0; i < tblData.Columns.Count; i++){ string inItemValue = inData.GetData(tbleData.Columns[i].ColumnName; if (string.compare(drTargetRow[i].ToString(), inItemValue)) != 0) drTargetRow[i] = inItemValue;}tblData.AcceptChanges();
////////////////////////////////////////////////////////////////////////