I have my Telerik RadPageView control (Q2 2011 SP1) 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 (yellow area in screen shots below). 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 (the draggable part of the control) to automatically resize to allow for this minimum height requirement.
Please see the screen shots from my sample application below:
Problem:

Desired:

Update:
I was able to create a function that programmatically adjusts the grip position when either the “Initialization” or “Resize” events fire. I realize I most likely will need to call this function when the selected page changes as well.
Anyway, here’s the snippet:
private void adjustPageViewGrip()
{
RadPageViewOutlookElement viewElement = (RadPageViewOutlookElement)radPageView.ViewElement;
int minHeight = 300;
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);
}
}
}
I am still curious whether or not I need this code. Can the control already do this?
I posted this same question on the Telerik forum and discovered that the control in fact does not support what I was asking above.
In the end, I tweaked the function to calculate the heights needed rather than hard coding them. Once the heights are calculated, the function shows or hides the correct number of pages needed. The function is now being called by the
OnLoad,Initialized,Resized, andSelectedPageChangedevents in an extended class. I also made theOutlookViewOverflowGripinvisible by collapsing it and I rely on the new code to adjust its position for me.Here’s the code for the final results: