Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6159403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:07:37+00:00 2026-05-23T21:07:37+00:00

I have a RIA services application I’m developing and am having problems with server

  • 0

I have a RIA services application I’m developing and am having problems with server side paging and the display of paged items in the DataGrid. I’m using a custom DomainService where the PageIndex & PageSize is passed via the Query along with several filter parameters.

The problem is my first page of results is displayed properly, but when I page to the next set of results, my items are tacked onto the end of the list instead of just showing the new results returned from the server. Ie, my DataGrid is showing all of the cumulative objects returned from the server instead of just displaying the latest page of results returned.

First, I’m using a DomainCollectionView and DomainCollectionViewLoader:


 _context = new StudyQueryContext();
_entityList = new EntityList(_context.PortalStudies);
_loader = new DomainCollectionViewLoader(Load, LoadComplete);
PortalStudies = new DomainCollectionView(_loader, _context.PortalStudies);      

Then I have the fairly standard Load() and LoadComplete() methods:


public LoadOperation Load()
{
    if (IsLoading)
    {
        return null;
    }

    IsLoading = true;
    EntityQuery q = _context.GetPortalStudyQuery(PatientsName, PatientId, AccessionNumber, PortalStudies.PageIndex, PortalStudies.PageSize);           
    return _context.Load(q);
}

private void LoadComplete(LoadOperation op)
{
    if (op.HasError)
    {
        System.Windows.MessageBox.Show(op.Error.ToString(), "Search Error", System.Windows.MessageBoxButton.OK);
        op.MarkErrorAsHandled();
    }
    else if (!op.IsCanceled)
    {
        _entityList.Source = op.Entities;
        _context.PortalCountAll(PatientsName, PatientId, AccessionNumber, CountAllComplete, null);
    }

    IsLoading = false;
}

Note that I assign TotalItemCount when the PortalCountAll method returns.

Just for completeness sake, the signature of my DomainService Query method is the following:


[Query]
public IEnumerable<PortalStudy> GetPortalStudy(string patientsName, string patientId, string accessionNumber, int startIndex, int pageSize)
{ }  

I’d assume the issue is with how I’m setting up _entityList and with the assignment of the results in the LoadComplete() method:

_entityList.Source = op.Entities;  

It seems that in all the LINQ based examples, this assignment seems to allow for only the current results to be displayed in the DataGrid. For some reason this doesn’t seem to be the case when using a custom query method.

I’m wondering what is the preferred way to clear the DataGrid when I change the page? I know I can just call _context.PortalStudies.Clear() to clear the results before I query, but this results in a flash on the page with the items cleared and not populated again until the query returns from the server. What is the proper way to display just the current page of results when using a custom DomainService?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T21:07:37+00:00Added an answer on May 23, 2026 at 9:07 pm

    You can (and should) pass the PageIndex and PageSize when working with a custom ORM that does not support LINQ. It will allow you to page against the ORM, but will also slightly complicate paging. You’ll either need to override DomainService.Count or add a totalCount out parameter.

    In your case, however, it looks like the bug is that you’ve passed the EntitySet (_context.PortalStudies) to the DCV constructor instead of the EntityList (_entityList).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a basic LINQ question. In my RIA Services Application, I have a
I have a simple Silverlight application that use WCF RIA Services to communicate with
Background Currently I have a C# Silverlight business application which uses RIA Services. The
Background Currently I have a C# Silverlight business application which uses RIA Services. The
I have created a RIA services class library project and things are not going
Is it possible to have a generic server-side query like the following? public IQueryable<TContact>
I have been building IMO a really cool RIA. But its now close to
Have you ever seen any of there error messages? -- SQL Server 2000 Could
Have you used VS.NET Architect Edition's Application and System diagrams to start designing a
Have a n-tire web application and search often times out after 30 secs. How

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.