Derik Whittaker



Using EventTriggers for DataRequested for RadJumpList

I am a fan of MVVM and I buy into the idea NOT using code behind it at all possible.  When using the Telerik RadJumpList (or anything based off of DataBoundListBox) there is a feature that you can enable which will all you to provide ‘infinite’ scroll ability to a list box which could contain virtually unlimited items.

Typically when you implement this behavior you need to do 2 things:

  1. Set the DataVirtualizationMode value, in my case I wanted OnDemandAutomatic
  2. Create an event handler in your views code behind to listen to the DataRequested event.

I have no ‘MVVM’ issues w/ the DataVirtualizationMode value being hard wired, but I really do not like the idea of having an event handler in my Code behind whos only job it is, is to call a method on my view model.  Fortunately for use we can solve this problem with ease by using EventTriggers.

Take a look at the xaml below for an example on how to accomplish this


Make sure you reference the namespace for System.Windows.Interactivity as below

Once you use this event trigger you can create a ICommand property on your ViewModel and avoid your code behind.

Hope this helps!

Till next time,

Posted 01-30-2014 7:38 AM by Derik Whittaker
Filed under: , ,


About The CodeBetter.Com Blog Network
CodeBetter.Com FAQ

Our Mission

Advertisers should contact Brendan

Google Reader or Homepage Latest Items
Add to My Yahoo!
Subscribe with Bloglines
Subscribe in NewsGator Online
Subscribe with myFeedster
Add to My AOL
Furl Latest Items
Subscribe in Rojo

Member Projects
DimeCasts.Net - Derik Whittaker

Friends of
Red-Gate Tools For SQL and .NET


SmartInspect .NET Logging
NGEDIT: ViEmu and Codekana
NHibernate Profiler
Balsamiq Mockups
JetBrains - ReSharper
Web Sequence Diagrams
Ducksboard<-- NEW Friend!


Site Copyright © 2007 CodeBetter.Com
Content Copyright Individual Bloggers


Community Server (Commercial Edition)