I have my RadPageView control setup as ViewMode "Outlook" in my winforms C# application. In my requirement, I have a limited space to display the control (about 600px of height). When the control has more than 5 pages added, the view panel (the open area above the page selectors) is made smaller and cuts off the content. I would like to know if there is a way to enforce a minimum height on this area so that the control will automatically collapse page selectors it cannot fit in this confined space. I need about 300px of height for each page.
I have already tried setting the MinimumSize property on each RadPageViewPage. However, when I do this, the page view page "bleeds" over the top of the page selectors. I was expecting the grip to automatically resize to allow for this minimum height requirement.
Please see the screen shots from my sample application attached.
Edit:
I am using the RadPageView control from Q2 2011 SP1
Update:
I was able to achieve what I was looking for using the following code snippet and calling it from the "Initialized" and "Resized" events. I would still like to know if the control already supports this without having to write this snippet.
I have already tried setting the MinimumSize property on each RadPageViewPage. However, when I do this, the page view page "bleeds" over the top of the page selectors. I was expecting the grip to automatically resize to allow for this minimum height requirement.
Please see the screen shots from my sample application attached.
Edit:
I am using the RadPageView control from Q2 2011 SP1
Update:
I was able to achieve what I was looking for using the following code snippet and calling it from the "Initialized" and "Resized" events. I would still like to know if the control already supports this without having to write this snippet.
private
void
adjustPageViewGrip()
{
RadPageViewOutlookElement viewElement = (RadPageViewOutlookElement)radPageView.ViewElement;
int
minHeight = 310;
int
itemHeight = radPageView.SelectedPage.Item.Size.Height;
int
selectedPageHeight = radPageView.SelectedPage.Height;
if
(selectedPageHeight < minHeight)
{
int
hide = (
int
)Math.Ceiling((
double
)(minHeight - selectedPageHeight) / (
double
)itemHeight);
if
(hide > 0)
{
viewElement.HideItems(hide);
}
}
else
if
((selectedPageHeight + itemHeight) >= minHeight)
{
int
show = (
int
)Math.Floor((
double
)(selectedPageHeight - minHeight) / (
double
)itemHeight);
if
(show > 0)
{
viewElement.ShowItems(show);
}
}
}