Location of ThumbsPanel and PageNavigation

Stimulsoft Ultimate discussion
Post Reply
User avatar
tpontow
Posts: 206
Joined: Thu Sep 06, 2012 8:46 am
Location: Bonn, Germany

Location of ThumbsPanel and PageNavigation

Post by tpontow »

Hello,

is it possible to change the Location of ThumbsPanel and PageNavigation in ReportViewer? I would like to show PageNavigation at top and ThumbsPanel on the left side of ReportViewer.

Thanks and kind regards
Thorsten Pontow
Thorsten Pontow

It is easier to write an incorrect program than to understand a correct one. (Alan J. Perlis, Epigrams in programming No. 7)
User avatar
tpontow
Posts: 206
Joined: Thu Sep 06, 2012 8:46 am
Location: Bonn, Germany

Re: Location of ThumbsPanel and PageNavigation

Post by tpontow »

And of course the FindBar!
Thorsten Pontow

It is easier to write an incorrect program than to understand a correct one. (Alan J. Perlis, Epigrams in programming No. 7)
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Location of ThumbsPanel and PageNavigation

Post by Alex K. »

Hello,

For change the location of PageNavigation and FindBar you can use the following code:

Code: Select all

this.viewerControl.StatusBar.Dock = DockStyle.Top;
this.viewerControl.FindBar.Dock = DockStyle.Top;
But change the location of ThumbsPanel is difficult. It is not enough to set a dock style. Also need change the location for splitter which changes the size of component and change the size of panel. For this task is needed add the specific method for any changes or make it from source code, if you have it.

Thank you.
User avatar
tpontow
Posts: 206
Joined: Thu Sep 06, 2012 8:46 am
Location: Bonn, Germany

Re: Location of ThumbsPanel and PageNavigation

Post by tpontow »

Hello Aleksey,

thanks for your help. FindBar works for me with your code. ThumbsPanel i will try next week.

Thank you
Thorsten Pontow
Thorsten Pontow

It is easier to write an incorrect program than to understand a correct one. (Alan J. Perlis, Epigrams in programming No. 7)
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Location of ThumbsPanel and PageNavigation

Post by Alex K. »

Hello,

We are always glad to help you!
Let us know if you need any additional help.

Thank you.
User avatar
tpontow
Posts: 206
Joined: Thu Sep 06, 2012 8:46 am
Location: Bonn, Germany

Re: Location of ThumbsPanel and PageNavigation

Post by tpontow »

Is it possible to give me some more information or maybe some piece of code how to move the ThumbsPanel from right to left?

I'm a little bit lost in how to achieve this goal!

Thank you
Thorsten
Thorsten Pontow

It is easier to write an incorrect program than to understand a correct one. (Alan J. Perlis, Epigrams in programming No. 7)
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Location of ThumbsPanel and PageNavigation

Post by Alex K. »

Hello,

Please try to use the following code after InitializeComponent():

Code: Select all

lbThumbs.Dock = DockStyle.Left;
splThumbs.Dock = DockStyle.Left;
scrollBarThumbs.Dock = DockStyle.Left;

int index = this.panelView.Controls.IndexOf(this.scrollBarThumbs) - 1;
this.panelView.Controls.SetChildIndex(scrollBarThumbs, index);
Thank you.
User avatar
tpontow
Posts: 206
Joined: Thu Sep 06, 2012 8:46 am
Location: Bonn, Germany

Re: Location of ThumbsPanel and PageNavigation

Post by tpontow »

Hello Aleksey,

your code works fine but i have to use reflection because lbThumbs, splThumbs and scrollBarThumbs are all private / internal. But that is ok form me now. At least i have the thumbnail panel on the left side.

I post my code here so that other developer can use it if they have to:

Code: Select all


private void MoveThumbNailsLeft()
        {

            if (!ReferenceEquals(ThumbNailsControl, null))
            {
                ThumbNailsControl.Dock = DockStyle.Left;

                if (!ReferenceEquals(ThumbNailsSplitter, null))
                {
                    ThumbNailsSplitter.Dock = DockStyle.Left;
                }

                if (!ReferenceEquals(ThumbNailsScrollBar, null))
                {
                    ThumbNailsScrollBar.Dock = DockStyle.Left;
                }
            }
        }

        protected VScrollBarAdv ThumbNailsScrollBar
        {
            get
            {
                Type viewerControlType = base.ViewerControl.GetType();
                VScrollBarAdv thumbNailsScrollBar = null;

                FieldInfo thumbNailsScrollBarField = viewerControlType.GetField("scrollBarThumbs", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static);
                if (!ReferenceEquals(thumbNailsScrollBarField, null))
                {
                    thumbNailsScrollBar = (VScrollBarAdv)thumbNailsScrollBarField.GetValue(base.ViewerControl);
                }
                return thumbNailsScrollBar;
            }
        }

        protected StiThumbsControl ThumbNailsControl
        {
            get
            {
                Type viewerControlType = base.ViewerControl.GetType();
                StiThumbsControl thumbsControl = null;

                FieldInfo thumbNailsField = viewerControlType.GetField("lbThumbs", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static);
                if (!ReferenceEquals(thumbNailsField, null))
                {
                    thumbsControl = (StiThumbsControl)thumbNailsField.GetValue(base.ViewerControl);
                }
                return thumbsControl;
            }
        }

        protected ExpandableSplitter ThumbNailsSplitter
        {
            get
            {
                Type viewerControlType = base.ViewerControl.GetType();
                ExpandableSplitter thumbNailsSplitter = null;

                FieldInfo thumbNailsSplitterField = viewerControlType.GetField("splThumbs", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static);
                if (!ReferenceEquals(thumbNailsSplitterField, null))
                {
                    thumbNailsSplitter = (ExpandableSplitter)thumbNailsSplitterField.GetValue(base.ViewerControl);
                }
                return thumbNailsSplitter;
            }
        }
base.ViewerControl is the instance of StiViewerControl where i want to move the Thumbnails panel. Replace that with your own StiViewerControl instance wherever it comes from.

Thanks and kind regards
Thorsten Pontow

It is easier to write an incorrect program than to understand a correct one. (Alan J. Perlis, Epigrams in programming No. 7)
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Location of ThumbsPanel and PageNavigation

Post by HighAley »

Hello.

Thank you for posting your solution.
Let us know if you will need any additional help.

Thank you.
Post Reply