I use a background worker to load data into my grid. It is not bound, due to special requests by the users, I must insert each row manually. After inserting all the data to the grid, I add a programmatic GroupByExpression to automatically group when the grid renders in my application and programmatically expand all the groups.
However, after upgrading to the latest Telerik Winform controls (Q3 2009), the vertical scrollbar disappears -only- for the grids where I have programmatic grouping with automatic group expansion. Other grids in the application do not have any problems.
Eventually I made the Vertical Scrollbar Visibility to be Always True. However, this still did not solve the problem. The scrollbar does not actually scroll. It is not recognizing that there are more rows to scroll down to. I've even tried manually adjusting the VScrollBar.Maximum value to no avail.
The scroll will work again if I remove the group on client side, then re-add it, or if I collapse a group then re-expand it, again on client side. But this is cumbersome for users. One other thing to note, if I do not Expand All Groups, the vertical scrollbar shows up perfectly and works fine after expanding the groups on the client side.
I have added a snippet of how I am adding the GroupExpressions below. As well as how I'm using Group Summary Event in this scenario.
private void pendingWorker_RunWorkerCompleted (object sender, RunWorkerCompletedEventArgs e) { |
try { |
this.gridView.Rows.Clear(); |
this.gridView.MasterGridViewTemplate.GroupByExpressions.Clear(); |
if (documentData != null && documentData.Rows.Count > 0) { |
int rowCount = 0; |
foreach (DataRow dr in documentData.Rows) { |
ModelObject obj = GetModelObject(dr); |
this.gridView.Rows.AddNew(); |
PopulateRow(obj, rowCount); |
rowCount++; |
} |
} |
this.gridView.MasterGridViewTemplate.GroupByExpressions.Add("[StatusColumn] Group By [StatusColumn]"); |
} catch (Exception ex) { |
messageToolTip1.ShowExceptionMessage(ex); |
logger.Error(ex); |
} |
CleanUpLoadingWorker(); |
} |
void OnGroupSumaryEvaluate (object sender, Telerik.WinControls.UI.GroupSummaryEvaluationEventArgs e) { |
try { |
if (e.FormatString.ToLower().Contains("status")) { |
e.FormatString = "STATUS STANDING : {0}"; |
this.gridView.MasterGridViewTemplate.ExpandAllGroups(); |
} |
} catch (Exception ex) { |
messageToolTip1.ShowExceptionMessage(ex); |
logger.Error(ex); |
} |
} |
Is there a workaround here that will satisfy user requirements and have the vertical scrollbar work as expected?
Thanks