This is a migrated thread and some comments may be shown as answers.

VirtualQueryableCollectionView, EntityFramework and MVVM

2 Answers 62 Views
Data Virtualization
This is a migrated thread and some comments may be shown as answers.
Dario Concilio
Top achievements
Rank 2
Dario Concilio asked on 29 Apr 2016, 12:23 PM

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 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 03 May 2016, 10:26 AM
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
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Dario Concilio
Top achievements
Rank 2
answered on 03 May 2016, 01:11 PM

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}"
                 ClearSelectionButtonVisibility="Visible"
                 ClearSelectionButtonContent="Cancella selezione"
                 ItemsSource="{Binding SottoConti}"
                 EmptySelectionBoxTemplate="{StaticResource EmptyTemplate}"
                 SelectedItem="{Binding Path=ContoContabile,Mode=TwoWay,ElementName=userControl}">
    <telerik:RadComboBox.ItemsPanel>
        <ItemsPanelTemplate>
            <VirtualizingStackPanel />
        </ItemsPanelTemplate>
    </telerik:RadComboBox.ItemsPanel>
    <telerik:RadComboBox.FilteringBehavior>
        <filter:SottoContiFilteringBehavior />
    </telerik:RadComboBox.FilteringBehavior>
</telerik:RadComboBox>

Tags
Data Virtualization
Asked by
Dario Concilio
Top achievements
Rank 2
Answers by
Stefan
Telerik team
Dario Concilio
Top achievements
Rank 2
Share this question
or