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

Gridview Sorting/ Filtering not working

5 Answers 161 Views
Data Virtualization
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Olena
Top achievements
Rank 1
Olena asked on 13 Mar 2012, 08:20 AM
Hello
Hope you can see what is wrong in the code below.
<telerik:RadGridView
            ColumnWidth="*"
            Grid.Row="2"
            IsBusy="{Binding IsLoadingDataEntries}"
            ItemsSource="{Binding DataEntries}"
            EnableRowVirtualization="True"
            Margin="0,10,0,0"
            SelectionMode="Extended">
            <i:Interaction.Behaviors>
                <controls:SelectedItemsBehavior SelectedItems="{Binding ViewModel.SelectedDataEntries, Source={StaticResource Container}}"/>
            </i:Interaction.Behaviors>
            
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Category.Name}" Header="Kategori" IsFilterable="True" IsGroupable="True" ShowDistinctFilters="False"/>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Classification}" Header="Klassifisering" IsFilterable="True" IsGroupable="True" ShowDistinctFilters="False"/>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Date, StringFormat=d}" Header="Datum" IsFilterable="True" IsGroupable="True" ShowDistinctFilters="False"/>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Amount, Converter={StaticResource NumberToStringConverter}}" Header="Värde" DataFormatString="{}{0:N2}" TextAlignment="Right" IsFilterable="True" IsGroupable="True" ShowDistinctFilters="False"/>
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>

        Private _dataEntries As VirtualQueryableCollectionView(Of DataEntry)
  Public Sub New(objectService As IObjectService)
            _dataEntries = New VirtualQueryableCollectionView(Of DataEntry)()
...
 DataEntries.LoadSize = 50
...
            AddHandler DataEntries.ItemsLoading, AddressOf OnDataEntriesLoading
...
end sub

  Public ReadOnly Property DataEntries As VirtualQueryableCollectionView(Of DataEntry)
            Get
                Return _dataEntries
            End Get
        End Property

 Private Sub OnDataEntriesLoading(sender As Object, e As VirtualQueryableCollectionViewItemsLoadingEventArgs)
            LoadDataEntries(e.StartIndex, e.ItemCount)
        End Sub

 Private Sub LoadDataEntries(startIndex As Integer, itemCount As Integer)
            IsLoadingDataEntries = True
            ObjectService.GetDataEntries(
                startIndex, itemCount,
                Sub(result)
                    DataEntries.VirtualItemCount = result.TotalItemCount
                    DataEntries.Load(startIndex, result.Items)
                    CreateNewEntry()
                    IsLoadingDataEntries = False
                End Sub)
        End Sub

Regards
Olena

5 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 13 Mar 2012, 08:43 AM
Hello,

 You need to use the collection FilterDescriptors to filter your data before loading using ItemsLoading event similar to our demos. 

All the best,
Vlad
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Olena
Top achievements
Rank 1
answered on 13 Mar 2012, 11:04 AM
Thanks! Would you please provide me with some code exemplas and/or references.
Regards
Olena
0
Vlad
Telerik team
answered on 13 Mar 2012, 12:20 PM
Hello,

 As I said in my previous reply - the code is part of our demos. 

Kind regards,
Vlad
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Olena
Top achievements
Rank 1
answered on 13 Mar 2012, 02:21 PM
Well, as I can see Telerik provides DataVirtualization exempel using WCF RIA Services but its not my case. My application consumes an ordinary WCF.
Regards
Olena
0
Accepted
Vlad
Telerik team
answered on 13 Mar 2012, 02:24 PM
Hi,

 I'm afraid that there is no support out-of-the-box for filtering with plain WCF services - just for WCF RIA services. 

Regards,
Vlad
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
Data Virtualization
Asked by
Olena
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Olena
Top achievements
Rank 1
Share this question
or