VirtualQueryableCollectionView - Refresh not working when VirtualItemCount == 0

4 posts, 0 answers
  1. Rafal
    Rafal avatar
    1 posts
    Member since:
    Feb 2011

    Posted 15 May 2012 Link to this post

    Hi, I use VirtualQueryableCollectionView with RadGridView and RIA Services. As ItemSource for RadGridView I used the following code:
    public VirtualQueryableCollectionView VirtualEventsList
                    if (_VirtualEventsList == null)
                        _VirtualEventsList = new VirtualQueryableCollectionView() { LoadSize = 50, VirtualItemCount = 1 };
                        _VirtualEventsList.ItemsLoading += (s, e) =>
                            EventListIsBusy = true;
                            var query = Context.GetEventsQuery(GetSelectedPositions());
                            var queryToLoad = query
                            Context.Load<Event>(queryToLoad).Completed += (sender, args) =>
                                var lo = (LoadOperation)sender;
                                if (lo.TotalEntityCount != -1 && lo.TotalEntityCount != _VirtualEventsList.VirtualItemCount)
                                    _VirtualEventsList.VirtualItemCount = lo.TotalEntityCount;
                                _VirtualEventsList.Load(e.StartIndex, lo.Entities);
                                EventListIsBusy = false;
                    return _VirtualEventsList;

    When I set QuickSearchFilterDescriptor.Value  then VirtualEventsList.Refresh()works fine. But when collection is filtered and  VirtualEventsList.VirtualItemCount == 0 then VirtualEventsList.Refresh()is not working. This problem I resolved this way when I set QuickSearchFilterDescriptor.Value:
    if (_VirtualEventsList.VirtualItemCount == 0)
       _VirtualEventsList.VirtualItemCount = 1;
    _EventCategoryFilterDescriptor.Value = FilteringValue;

    The problem is when I use the filter on Column in RadGridView. When collection returns 0 records and I change filter value, then Refresh is not working. Do you have any clues?
  2. ATeam
    ATeam avatar
    24 posts
    Member since:
    Jan 2010

    Posted 24 May 2012 Link to this post


    we also have the same Problem.

    We are using the VQCV with pure WCF Services, but when a Filter is active which causes the ItemsSource to return 0 rows - then no Refresh will trigger. (Which means that no ItemsLoading Event will be fired and we will never reload data!)

    The behavior is alos strange because, when we clear the FieldFilter or DistinctFilter on the column (in the GUI or Code) no refresh will be triggered (The Filter Descriptor Collection on VQCV is empty but that doesnt solve the issue).

    Also a recreate of the VQCV an Binding to the Itemssource of the RadGridView doesnt help - same issue.

    If a user comes to the above described state,he will never get any Data until he closes the application. Currently I have no idea how to solve this Issue! Please help Telerik!

    Kind Regards,
  3. DevCraft banner
  4. Dimitrina
    Dimitrina avatar
    3769 posts

    Posted 24 May 2012 Link to this post


     In our online example setting the VirtualItemsCount initially to "some" value is the way you can deal with the fact at a time the real count is not yet available. 

    All the best,
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  5. ATeam
    ATeam avatar
    24 posts
    Member since:
    Jan 2010

    Posted 24 May 2012 Link to this post

    Hi Didie,

    thanks for your quick response, but your solution didn't work in my scenario!

    I've also had set the VirtualItemCount property on initialization of the VQCV to the value: of the initial PageSize. After getting a response from the web server i have set the VirtualItemCount to the "real" count value for this query.

    Have you another suggestion for solving this issue?

    Kind regards!
Back to Top