Gridview Sorting/ Filtering not working

6 posts, 1 answers
  1. Olena
    Olena avatar
    11 posts
    Member since:
    Feb 2011

    Posted 13 Mar 2012 Link to this post

    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
  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 13 Mar 2012 Link to this post

    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 >>
  3. DevCraft banner
  4. Olena
    Olena avatar
    11 posts
    Member since:
    Feb 2011

    Posted 13 Mar 2012 Link to this post

    Thanks! Would you please provide me with some code exemplas and/or references.
    Regards
    Olena
  5. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 13 Mar 2012 Link to this post

    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 >>
  6. Olena
    Olena avatar
    11 posts
    Member since:
    Feb 2011

    Posted 13 Mar 2012 Link to this post

    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
  7. Answer
    Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 13 Mar 2012 Link to this post

    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 >>
Back to Top
DevCraft banner