AUTHOR: Dimitar Karamfilov
DATE POSTED: March 19, 2015
Problem This article demonstrates how you can change the current page when a page is hovered and how you can animate the page expanding.
System.Windows.Forms.Timer timer;
RadPageViewPage currentPage;
public
RadForm1()
{
InitializeComponent();
RadPageViewExplorerBarElement explorerBarElement = radPageView1.ViewElement
as
RadPageViewExplorerBarElement;
foreach
(RadPageViewExplorerBarItem item
in
explorerBarElement.Items)
item.MouseHover += item_MouseHover;
item.AssociatedContentAreaElement.RadPropertyChanging += AssociatedContentAreaElement_RadPropertyChanging;
}
timer =
new
System.Windows.Forms.Timer();
timer.Interval = 30;
timer.Tick += timer_Tick;
radPageView1.PageExpanded += radPageView1_PageExpanded;
void
timer_Tick(
object
sender, EventArgs e)
currentPage.PageLength += 20;
if
(currentPage.PageLength >= 300)
timer.Stop();
radPageView1_PageExpanded(
sender, RadPageViewEventArgs e)
currentPage = e.Page;
currentPage.PageLength = 0;
timer.Start();
AssociatedContentAreaElement_RadPropertyChanging(
sender, RadPropertyChangingEventArgs args)
(args.Property.Name ==
"Bounds"
)
//suspend layout when animating
args.Cancel = timer.Enabled;
item_MouseHover(
RadPageViewExplorerBarItem item = (RadPageViewExplorerBarItem)sender;
(RadPageViewExplorerBarItem i
i.IsExpanded =
false
;
item.IsExpanded =
true
Private
timer
As
System.Windows.Forms.Timer
currentPage
RadPageViewPage
Public
Sub
New
()
InitializeComponent()
Dim
explorerBarElement
RadPageViewExplorerBarElement = TryCast(radPageView1.ViewElement, RadPageViewExplorerBarElement)
For
Each
item
RadPageViewExplorerBarItem
In
explorerBarElement.Items
AddHandler
item.MouseHover,
AddressOf
item_MouseHover
item.AssociatedContentAreaElement.RadPropertyChanging,
AssociatedContentAreaElement_RadPropertyChangin
Next
System.Windows.Forms.Timer()
timer.Interval = 30
timer.Tick,
timer_Tick
radPageView1.PageExpanded,
radPageView1_PageExpanded
End
ByVal
sender
Object
,
e
EventArgs)
currentPage.PageLength += 20
If
currentPage.PageLength >= 300
Then
timer.
Stop
RadPageViewEventArgs)
currentPage = e.Page
currentPage.PageLength = 0
timer.Start()
args
RadPropertyChangingEventArgs)
args.
Property
.Name =
'suspend layout when animating
args.Cancel = timer.Enabled
RadPageViewExplorerBarItem =
DirectCast
(sender, RadPageViewExplorerBarItem)
i
False
True
Resources Buy Try