Archives / 2010 / July
  • Silverlight DataGrid and DataPager Notes

    I need to write these things down somewhere...

    Brad's excellent tutorials and samples for learning Silverlight + RIA Services:

    Scott's super blog post about columns and the DataGrid: (it's getting "old" but still rocks)

    To use the DataPager properly with a DomainDataSource, you have to set a sort order. The docs for the DataPager says:

    If you use the DataPager in an application with an Entity Framework data store, you must order the data returned by your queries for the DataPager to work correctly. The Entity Framework does not support paging of data without an OrderBy clause.

    This can be done with the SortDescriptor property of the DomainDataSource, for example:

    <riaControls:DomainDataSource  Name="dds" AutoLoad="True"         
                                   LoadSize="20" LoadedData="dds_LoadedData">
            <Services:SomeDomainContext />
            <riaControls:SortDescriptor PropertyPath="name" Direction="Ascending"/>