VirtualQueryableCollectionView, EntityFramework and MVVM

3 posts, 0 answers
  1. Dario Concilio
    Dario Concilio avatar
    180 posts
    Member since:
    Apr 2016

    Posted 29 Apr 2016 Link to this post

    Hi to all,

    I'm developing a MVVM Application, I have a global context for application, I have a provider class that exposes me a method that returns a List<MyModel>

    MyModel is a class that I use internally in application:

    My entityframework context (EF5 & FW4.0) exposes MyTable (this table corresponde to MyModel class).

    My provider get IQuarable<MyTable> by linq and convert all items in MyModel, then return List<MyModel>.

    Now, If I have a lot of records and I have to show all items into ComboBox, I could user VirtualQueryableCollectionView.

    But how can I use List<MyModel> to do this? I will get the same result?

  2. Stefan
    Stefan avatar
    904 posts

    Posted 03 May 2016 Link to this post

    Hi Potito,

    Can you please check out the VirtualQueryableCollectionView API Reference? As shown in it, the contstructor of VQCV accepts an IEnumerable as a parameter, so you should be able to pass the fetched collection to it.

    Can you please check it out and let me know in case I am missing something?

    All the best,
    Stefan X1
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. Dario Concilio
    Dario Concilio avatar
    180 posts
    Member since:
    Apr 2016

    Posted 03 May 2016 in reply to Stefan Link to this post

    At the end I choose use this approach:

    I used List<MyModel> and add tag <VirtualizingStackPanel/>

    I got the desired result :-)

    <telerik:RadComboBox ItemTemplate="{StaticResource ComboBoxTemplate}"
                     ClearSelectionButtonContent="Cancella selezione"
                     ItemsSource="{Binding SottoConti}"
                     EmptySelectionBoxTemplate="{StaticResource EmptyTemplate}"
                     SelectedItem="{Binding Path=ContoContabile,Mode=TwoWay,ElementName=userControl}">
                <VirtualizingStackPanel />
            <filter:SottoContiFilteringBehavior />

Back to Top