Note that there are some explanatory texts on larger screens.

plurals
  1. POSilverlight 4 toolkit DataForm including blank items when browsing through collection
    primarykey
    data
    text
    <p>I have a simple dataform created that reads address information.<br> The address information is stored across multiple tables: Address, City, Province, Country. To simplify this question, I will only refer to Address and City. I'm accessing the data through WCF RIA Services context. My query in the Service is:</p> <pre><code>public IQueryable&lt;Address&gt; GetAddresses() { return from Ad in ObjectContext.Addresses .Include("City") // .Include("City.Province") // .Include("City.Province.Country") where Ad.AddressID == 10 select Ad; } </code></pre> <p>To help with my debugging, I've limited the result set to one address (where Ad.AddressID ==10). In the Service metadata the city table is included:</p> <pre><code> [Include] public City City { get; set; } </code></pre> <p>My DataForm's read only template looks like:</p> <pre><code> &lt;dataFormToolkit:DataForm.ReadOnlyTemplate&gt; &lt;DataTemplate&gt; &lt;Grid&gt; &lt;Grid.RowDefinitions&gt; &lt;RowDefinition Height="Auto" /&gt; &lt;RowDefinition Height="Auto" /&gt; &lt;/Grid.RowDefinitions&gt; &lt;Grid.ColumnDefinitions&gt; &lt;ColumnDefinition /&gt; &lt;/Grid.ColumnDefinitions&gt; &lt;dataFormToolkit:DataField Label="Street Address" &gt; &lt;TextBox Text="{Binding Path=StreetAddress, Mode=TwoWay}" /&gt; &lt;/dataFormToolkit:DataField&gt; &lt;dataFormToolkit:DataField Grid.Row="1" Label="City" &gt; &lt;TextBox Text="{Binding Path=City.CityName, Mode=TwoWay}" /&gt; &lt;/dataFormToolkit:DataField&gt; &lt;/Grid&gt; &lt;/DataTemplate&gt; &lt;/dataFormToolkit:DataForm.ReadOnlyTemplate&gt; </code></pre> <p>Now, when I debug my DataForm, I'm expecting just the 1 address record to display. But it actually brings back 2 records: the expected address record and the linked City record. The first record that shows up is the address including the linked city. The second shows up as blank, but when breaking into the code, the DataForm's CurrentItem shows that it's the City record linked to the first address.</p> <p>How do I restrict the items in the DataForm to display and browse through just those from the Address table?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload