IReportTotalRowCount in Csla for Silverlight?

IReportTotalRowCount in Csla for Silverlight?

Old forum URL:

Gareth posted on Wednesday, February 10, 2010

Hi there I'm trying to implement server side paging, sorting and grouping with a Telerik Gridview control and Csla.NET for Silverlight but it would appear that the Csla.NET Silverlight code does not support the IReportTotalRowCount interface defined in Csla.Core. Is there any reason for this?

Has anyone got server-side paging, sorting and grouping working with a 3-tier Silverlight application?




RockfordLhotka replied on Wednesday, February 10, 2010

In SL2 Microsoft hadn't defined any formal paging scheme for Silverlight. I'm not aware of any formal concept in SL3 either - though I may have missed it?

IReportTotalRowCount is part of a broader solution for paging that integrates with the Web Forms 2.0 paging model, which is why it exists. Since Web Forms doesn't run inside Silverlight it didn't make sense to support that interface.

How does Telerik handle paging?

RockfordLhotka replied on Friday, March 05, 2010

I put together a small sample showing a couple paging approaches for use in Silverlight (or WPF).

The code is based on CSLA 4, so it won't directly work in 3.8, but I think the only thing that needs changing for 3.8 would be the PagedCriteria class (the property declarations won't work in 3.8).

But the overall concept and approach is consistent with what you'd expect to see for any smart client scenario - Silverlight, WPF or even Windows Forms.

The sample shows an automatic technique and a manual technique.

The automatic technique has the collection's factory method retrieve the first page of data, and then start an async load of subsequent pages one at a time. Each subsequent page is merged into the existing collection as it arrives. The async data portal ensures that the callback occurs on the UI thread, so this is pretty easy stuff. This technique is good if the user typically uses the whole list, but you don't want them to wait while it is retreived.

The manual technique is similar, but requires that the UI request the next page. This technique is good if the user typically doesn't use the whole list, because you don't waste the time loading everything unless the user actually wants to use it.

I'm sure there are many other variations on the concept - but this sample should be enough to get most people started with basic async paged loading of a BLB.

tiago replied on Thursday, August 26, 2010

Hi Rocky,

I tried this today. It builds but it crashes at MainViewModel.cs method OnRefreshed()

System.NullReferenceException was unhandled by user code
  Message=Object reference not set to an instance of an object.
       at PagedList.MainViewModel.OnRefreshed()
       at Csla.Xaml.ViewModelBase`1.QueryCompleted(Object sender, EventArgs e)
       at Csla.DataPortal`1.OnFetchCompleted(DataPortalResult`1 e)
       at Csla.DataPortal`1.proxy_FetchCompleted(Object sender, DataPortalResult`1 e)
       at Csla.DataPortalClient.WcfProxy`1.OnFetchCompleted(DataPortalResult`1 e)
       at Csla.DataPortalClient.WcfProxy`1.proxy_FetchCompleted(Object sender, FetchCompletedEventArgs e)
       at Csla.WcfPortal.WcfPortalClient.OnFetchCompleted(Object state)

tiago replied on Thursday, August 26, 2010

Projects Library.Net and DataAccess are expecting to find a Csla.dll in the Server folder. I add to tell them to look for it under Client

stefan replied on Wednesday, January 12, 2011

Hi @all,

this is still an issue for me.

I am running the PagedList sample out of the box and get the same exception.

Model == null in OnRefreshed...

I am just starting with Silverlight, so I strongly assume that there is just a little piece of knowledge missing on my part.

It feels like a missing piece between client and server.

Any help greatly appreciated.

stefan replied on Wednesday, January 12, 2011

Solved: Just have to navigate to the right .html or .aspx page in the browser. I knew it was so simple.

Somehow expected that the sample would open with the right page.

But this way we have both an .html and a .aspx sample page...

Sorry for my post Embarrassed

RockfordLhotka replied on Wednesday, January 12, 2011

Visual Studio loses the start page information as the code passes through source control. Apparently that info is in each developer's user file, and as a general rule those user files aren't put into source control...

Copyright (c) Marimer LLC