Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
990
scroll in pivotgrid
posted

Hi,

i am binding the scroll of the pivot grid to the scroll of the datachart

when in the chart the view is 12 months or less, i want the grid to show same number of months (columns) and when we scroll the chart, the grid scrolls also, and vice-verca.

when the view (zoom) of the chart is more than 12, i want the grid to show only 12 columns, and when we scroll the chart, the grid scroll to this view, and when we scroll the grid, the chart scrolls too but on release.

I did this:

 PivotColumnsPanel obj = GetObject(this.pivotGrid, "ColumnsHeaderPanel") as PivotColumnsPanel;

double columnWidth = obj.RenderSize.Width / 12;

                if (obj.RenderSize.Width > 0)

                {     for (int index = 0; index < nbmonths - 1; index++)

                    {   pivotGrid.DataColumns[index].ColumnWidth = columnWidth-2;

                    }

                    Grid grid = GetObject(pivotGrid, "GridControlLayout") as Grid;

                    ScrollBar scroll = grid.Children[2] as ScrollBar;

                    Binding binding = new Binding

                    {Source = this.DataChart,

                        Path = new PropertyPath("HorizontalZoombar.Range"),

                        Mode = BindingMode.TwoWay,

                        Converter = new ZoomBarConverter()

                    };

                    scroll.SetBinding(ScrollBar.ValueProperty, binding);

                }

            }

This only works for 12 months view, but how to make it for more than 12 and less than 12?

Thanks,

nharake

  • 17559
    Suggested Answer
    posted

    Hello nharake,

     

    It has been a while since you made this post, and if you still require any further assistance on this matter I will be glad to help. Since version 11.2 our XamPivotGrid provides new feature that allows you to integrate the control with XamDataChart with OlapAxis:

    http://localhost:1024/SamplesBrowser/RunSamples.aspx?cn=pivot-grid#/pivot-grid/integration-with-datachart

     

    This way if you provide to both controls the same olap data source the axes will be synchronized all the time, so you will have the same columns all the time. Would you please provide me with some additional detail do you use OlapAxes in your scenario and would you please send me a screenshot that demonstrates the requested design in case you have more than 12 visible columns in the XamDataChart.

     

    Thanks in advance.