wcf ria services - Silverlight 4 toolkit DataForm including blank items when browsing through collection -


i have simple dataform created reads address information.
address information stored across multiple tables: address, city, province, country. simplify question, refer address , city. i'm accessing data through wcf ria services context. query in service is:

public iqueryable<address> getaddresses()     {         return ad in objectcontext.addresses                .include("city")                // .include("city.province")                // .include("city.province.country")                ad.addressid == 10                select ad;     } 

to debugging, i've limited result set 1 address (where ad.addressid ==10). in service metadata city table included:

        [include]         public city city { get; set; } 

my dataform's read template looks like:

      <dataformtoolkit:dataform.readonlytemplate>         <datatemplate>             <grid>                 <grid.rowdefinitions>                     <rowdefinition height="auto" />                     <rowdefinition height="auto" />                 </grid.rowdefinitions>                 <grid.columndefinitions>                     <columndefinition />                 </grid.columndefinitions>                  <dataformtoolkit:datafield label="street address" >                     <textbox text="{binding path=streetaddress, mode=twoway}" />                 </dataformtoolkit:datafield>                  <dataformtoolkit:datafield grid.row="1" label="city" >                     <textbox text="{binding path=city.cityname, mode=twoway}" />                 </dataformtoolkit:datafield>             </grid>         </datatemplate>     </dataformtoolkit:dataform.readonlytemplate> 

now, when debug dataform, i'm expecting 1 address record display. brings 2 records: expected address record , linked city record. first record shows address including linked city. second shows blank, when breaking code, dataform's currentitem shows it's city record linked first address.

how restrict items in dataform display , browse through address table?

it turns out loading 'allentities' in code behind.

dfadd.itemssource = addressdataloadresult.allentities; 

so fix change itemssource load 'entities'. restricted collection address objects only.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -