Hi,
I modified the pivotGrid DataSource and did a RefreshGrid.
After refresh I can't scroll through all my items in the grid. The scrollbar changed and lets me scroll through only some of the items.
Looks like a bug.
Could you please suggest a work around.
Hello,
Could you specify how exactly you have modified the DataSource? Basically there are very rare cases where you have to call RefreshGrid on yourself because both the data source and the pivot grid keep attention to changes and they do that internally.Regards.Plamen.
Hi Plamen,
Here is something else I noticed:
When I comment out tree expansion code and hiding totals code in LayoutLoaded event, then the scrolling seems fine. Although I can't seem to expand the Date Hierarchy Row.
Is there a better event to expand tree and hide totals?
private void PivotGrid_LayoutLoaded(object sender, EventArgs e) { // Turn off col totals foreach (PivotDataColumn col in pivotGrid.DataColumns) { if (col.IsTotal) col.IsVisible = false; } // Turn off row totals foreach (PivotDataRow row in pivotGrid.DataRows) { if (row.IsTotal) row.IsVisible = false; } // Expand Column Hierarchy foreach (PivotHeaderCell cell in pivotGrid.GridLayout.ColumnHeaderCells) { if (cell.IsToggleVisible && cell.IsExpanded == false) { cell.IsExpanded = true; return; } } // Expand Row Hierarchy foreach (PivotHeaderCell cell in pivotGrid.GridLayout.RowHeaderCells) { if (cell.IsToggleVisible && cell.IsExpanded == false) { cell.IsExpanded = true; return; } } }
Thanks
Sangeetha
Sure Elena,
(1) Turn totals off and expand grid in PivotGrid_LayoutLoaded event as mentioned in the earlier message.
(2) Edit the PivotGrid's FlatDataSource and refresh using pivotGrid.DataSource.Refresh() as follows:
{
...
FlatDataSource fds = pivotGrid.DataSource as FlatDataSource; Type t = fds.ItemsSource.GetType(); counter = 0; IEnumerator enumerator = fds.ItemsSource.GetEnumerator(); while (enumerator.MoveNext()) { Type type = enumerator.Current.GetType(); string indexName = type.GetProperty("Index Name").GetValue(enumerator.Current, null) as string; if (indexName.Equals(selectedIndex)) { double dval = 0; try { object oval = type.GetProperty(selectedValueColumn).GetValue(enumerator.Current, null); dval = double.Parse(oval.ToString()); } catch (Exception ex) { } type.GetProperty(selectedValueColumn).SetValue(enumerator.Current, dval + shift + (step * counter++), null); } } pivotGrid.DataSource.RefreshGrid();
}
I resolved the problems as follows:
===========================
(1) Toggle Totals visibility via a MenuItem
(2) Expand hierarchy as follows:
private void OnPivotGrid_ResultChanged(object sender, AsyncCompletedEventArgs e) { var dataSource = pivotGrid.DataSource; if (dataSource != null) { IResult result = dataSource.Result; if (result != null) { if (!_axisExpansionChangedManually) { IResultAxis axis = dataSource.Result.RowAxis; if (axis != null) { // expand the first row hierarchy, if it exists IMember firstRowMember = axis.Tuples.First().Members.First(); if (firstRowMember.Members.Count != 0) dataSource.SwitchAxisMember(firstRowMember); } } _axisExpansionChangedManually = false; } } //pivotGrid.DataSource.ResultChanged -= xamPivotGrid_ResultChanged; }
Hope that helps.
Hello Sangeetha,
I investigated your issue and I followed the steps that you described, however I am not able to reproduce the scrolling issue. Could you please modify the attached sample so the incorrect behavior is reproducible.
Thanks in advance.
I am just checking have you been able to resolve your issue. If you need any further assistance on the matter, please do not hesitate to ask.
Hi Elena,
Here it is.
Thank you for modifying the sample. I am currently investigating this issue and I will get back to you in a business day.
The service release containing the fix for your issue is out, you can download it from: https://ko.infragistics.com/Membership/Default.aspx?panel=Downloads#Downloads
I'd be glad to receive a feedback on the outcome.
Thank You Elena.
I research the issue with scrollbar resizing that you have described and I have asked our developers to investigated further. I created a case with number CAS-70205-SS53YC for you in our support system and linked it with the Developer issue ID 86117, so that you can get automatically updated, when a Service Release containing the fix is available for download. You can get the new version from our website’s “My IG”, “My Keys & Downloads” tags:
https://ko.infragistics.com/Membership/Default.aspx?panel=Downloads#Downloads
You can also monitor the support ticket’s progress through the “My Support Activity” tag:
https://ko.infragistics.com/Membership/MySupport.aspx .
If you have any additional questions on this please do not hesitate to ask.