Note that there are some explanatory texts on larger screens.

plurals
  1. POSL4 | DomainDataSource / DataGrid | Adding a blank row to insert new items
    primarykey
    data
    text
    <p>I'm trying to bind a DataForm and DataGrid to a DomainDataSource and implement the functionality of adding, deleting and editing items.</p> <p>Everything works very well for the DataForm part. But how I'm able to add a new record using the DataGrid? Like I know until now, there are two working options:</p> <ol> <li><p>Add a new - "blank" - item to the DataView.</p> <ul> <li>Problem: I'm getting validatoin errors as a result of key requirements and constraints.</li> </ul></li> <li><p>Using the "SDK feature to enable Add New Row capabilities in DataGrid control" from Silverlight 4 service release (September 2010)</p> <ul> <li>Problem: What exactly has changed? There are no new members or a documentation.</li> </ul></li> </ol> <p>Here are some basic markup declarations matching the most important parts of my project:</p> <p> </p> <pre><code>&lt;Grid x:Name="LayoutRoot"&gt; &lt;sdk:DataGrid x:Name="ParentGrid" AutoGenerateColumns="False" ItemsSource="{Binding ElementName=parentDomainDataSource, Path=Data}"/&gt; &lt;toolkit:DataForm x:Name="ParentForm" CommandButtonsVisibility="All" Grid.Row="1" ItemsSource="{Binding ElementName=parentDomainDataSource, Path=Data}"/&gt; &lt;sdk:DataGrid x:Name="ChildGrid" Grid.Column="1" AutoGenerateColumns="False" ItemsSource="{Binding ElementName=childDomainDataSource, Path=Data}"/&gt; &lt;toolkit:DataForm x:Name="ChildForm" CommandButtonsVisibility="All" ItemsSource="{Binding ElementName=childDomainDataSource, Path=Data}"/&gt; &lt;riaControls:DomainDataSource AutoLoad="True" d:DesignData="{d:DesignInstance my1:Child, CreateList=true}" Name="childDomainDataSource" QueryName="GetChildrenQuery" DomainContext="{StaticResource domainCtx}"/&gt; &lt;/riaControls:DomainDataSource&gt; &lt;riaControls:DomainDataSource AutoLoad="True" d:DesignData="{d:DesignInstance my1:Parent, CreateList=true}" Name="parentDomainDataSource" QueryName="GetParentsQuery" DomainContext="{StaticResource domainCtx}"/&gt; &lt;/Grid&gt; </code></pre> <p></p> <p>Unfortunately, I'm running out of time.</p> <p>Thanks in advance for any help. Best regards from Germany. Hope anybody can help ;)</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