locked
Does DomainDataSource GroupDescriptor PropertyPath support dotted notation ? RRS feed

  • Question

  • I have a domain data source that returns all the "Chapters" in my database. Inside a Chapter entity is a Book entity. In my GetChapters domain service I Include the Book in the returned entities by marking the Book property in the metadata file with the [Include] attribute and making my query against my EntityFramework entity model use the ".Include" (e.g. return this.Context.Chapters.Include ( "Book" ); ) Please overlook the fact that there are "better ways to model this" as I'm only using this test database to explore some Silverlight 3 / RIA domain service techniques.

    I tried setting a group descriptor for my DomainDataSource using dotted notation (e.g. Book.BookTitle) and the data grid just shows 1 group titled "Book.BookTitle" as opposed to a group for each Book. I know I'm getting the Book.BookTitle returned after the LoadChapters because I have a DataGridTextColumn showing that field using <data:DataGridTextColumn Header="Book title" Binding="{Binding Book.BookTitle}" /> and it looks fine.

    The RIA Services Overview says that the SortDescriptor PropertyPath supports the dotted notation but the GroupDescriptor section doesn't say anything explicitly about supporting it so I was wondering if this is supposed to work or not ?

    Monday, April 13, 2009 2:24 PM

All replies

  • That's an excellent question.  I ran into the same situation and haven't been able to find an answer either...

    Thursday, May 7, 2009 7:47 PM
  •  I am encountering the same problem. Did somebody figure this out?

     

    Thank you.

     

    Didier

    Friday, June 5, 2009 2:42 PM
  • I have experienced the same problem and could not get the thing to work.

    The group title shows the property name instead of the property content.

     It's like when you use a listview without a template.

    Friday, June 5, 2009 4:44 PM
  • It should work. When I try with AdventureWorks DataBase and set Employee1.Title as the GrouptDescriptor property path, it works fine.

    Saturday, June 6, 2009 12:47 AM
  • Are you using a Sort Descriptor in your Domain Data Source?  The reason why I ask is that if you don't include a Sort Descriptor in the Domain Data Source and try to use a DataPager control, it doesn't retrieve data after you've loaded your initial LoadSize.  This might be something of a similar nature.

     

    Please mark as answer if this helps

    Thursday, August 20, 2009 11:28 AM
  • Are you using a Sort Descriptor in your Domain Data Source?  The reason why I ask is that if you don't include a Sort Descriptor in the Domain Data Source and try to use a DataPager control, it doesn't retrieve data after you've loaded your initial LoadSize.  This might be something of a similar nature.

    Please mark as answer if this helps

     This is only with EntityFramework. There is a known EF limitation with Skip and Take if there is no sort order specified.

    Our recommendation is to modify your query to add Order By. It can be on anything .... primary key, name etc .

    alternatively you can add a sort descriptor.

     

    Unfortunately, there is nothing we can do from Domain Data Source to work around the problem described by Ardman.

    Thursday, August 20, 2009 2:56 PM
  • I have the same problem. I want to group by the name column in the type table. What is the proper way to reference it?

    <riaControls:DomainDataSource.GroupDescriptors>

    <datagroup:GroupDescriptor PropertyPath="AssessmentType.AssessmentTypeName" />

    </riaControls:DomainDataSource.GroupDescriptors>

    Sunday, September 13, 2009 7:02 PM
  • my bad. It does work.

    I have to add the [Include] in AssessmentMetadata 

    [Include]
    public AssessmentType AssessmentType;

    and include it in the Get

    public IQueryable<Assessment> GetAssessment()
    {
    return this.Context.Assessment.Include("AssessmentType");
    }

    Sunday, September 13, 2009 7:19 PM