Manual OnDemand DataboundListbox

3 posts, 1 answers
  1. Dele
    Dele avatar
    23 posts
    Member since:
    Jun 2012

    Posted 24 Aug 2011 Link to this post

    I have wired up my listbox with the "OnDemandManual" virtualization mode, along with a data virtualization item template like so.
    <telerikPrimitives:RadDataBoundListBox x:Name="lbJobSearchResults"
                                                       EmptyContent=" "
                                                       ItemsSource="{Binding JobSearchResults}"
                                                       ItemTemplate="{StaticResource SearchResultListTemplate}"
                                                       SelectedItem="{Binding SelectedJobResult, Mode=TwoWay}"
                            <Button Margin="-12, 0, -12, 0"
                                    Content="load more"
                                    Command="{Binding LoadMoreJobsCommand, Mode=OneWay}" />

    As you can see, I would like to fire off a command when i click on the load more button.  but the command doesn't even seem to be registering.  is this possible via commanding, or do I need to call the command via my code-behind?
  2. Answer
    Georgi avatar
    296 posts

    Posted 26 Aug 2011 Link to this post

    Hi Dele,

    Thank you for contacting us.

    In order to have the proper DataContext passed to the underlying ContentControl that visualizes the DataVirtualizationItemTemplate , you should also set the DataVirtualizationItemContent property to the view model that contains the command instance:

    <telerik:RadDataBoundListBox x:Name="radListBox" DataVirtualizationMode="OnDemandManual" DataVirtualizationItemContent="{Binding}">

    Still, this code will not work, because I have found a bug with updating the Content property. I would like to thank you for bringing our attention to this issue. Your Telerik points are updated as a token for our gratitude for your time and feedback.

    The bug will be fixed in the next internal build (available within a week or two). Currently you may use a StaticResource binding and set the Command property as a local value of the button.

    Once again - thanks for your feedback. Do not hesitate to contact us with any question/problem you may have with our tools.

    All the best,
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  3. DevCraft banner
  4. Dele
    Dele avatar
    23 posts
    Member since:
    Jun 2012

    Posted 28 Aug 2011 Link to this post

    Thanks for the info Georgi.

    I already have a workaround, but will look forward to when this is available.
Back to Top