Page 1 of 1
Location of ThumbsPanel and PageNavigation
Posted: Fri May 03, 2013 8:59 am
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
Re: Location of ThumbsPanel and PageNavigation
Posted: Fri May 03, 2013 9:12 am
by tpontow
And of course the FindBar!
Re: Location of ThumbsPanel and PageNavigation
Posted: Fri May 03, 2013 11:24 am
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.
Re: Location of ThumbsPanel and PageNavigation
Posted: Fri May 03, 2013 11:38 am
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
Re: Location of ThumbsPanel and PageNavigation
Posted: Fri May 03, 2013 12:10 pm
by Alex K.
Hello,
We are always glad to help you!
Let us know if you need any additional help.
Thank you.
Re: Location of ThumbsPanel and PageNavigation
Posted: Thu May 16, 2013 11:26 am
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
Re: Location of ThumbsPanel and PageNavigation
Posted: Thu May 16, 2013 11:54 am
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.
Re: Location of ThumbsPanel and PageNavigation
Posted: Wed May 22, 2013 1:28 pm
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
Re: Location of ThumbsPanel and PageNavigation
Posted: Thu May 23, 2013 12:45 pm
by HighAley
Hello.
Thank you for posting your solution.
Let us know if you will need any additional help.
Thank you.