This project is read-only.
Project Description
An extended DataForm from the Silverlight Toolkit for showing parent properties in comboboxes.

Written in C#.

How to use

Add a reference to nisbus.Silverlight.Controls to your project and add a ReferenceDataForm control to a page.
On the page add a DomainDataSource (from the RIA.Controls dll.) and set the ReferenceDataForm's DomainDataSource property to the pages DomainDataSource.
Also set the DisplayPropertyName property for the default property name to be displayed in parent comboboxes.

Pseudo code:

C#

public partial class Demo : UserControl
{
public Demo()
{
this.ReferenceDataForm.DomainDataSource = this.dds;
this.DisplayPropertyName = "Name";
}
}

XAML:

<UserControl x:Class="DEMO.Demo"
xmlns:dataFormToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.DataForm.Toolkit"
xmlns:riaControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Ria.Controls"
xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:nisbus="clr-namespace:nisbus.Silverlight.Controls;assembly=nisbus.Silverlight.Controls">
<Grid>
<riaControls:DomainDataSource x:Name="dds"
AutoLoad="True"
LoadSize="20">
<riaControls:DomainDataSource.DomainContext>
<App:DemoDomainContext/>
</riaControls:DomainDataSource.DomainContext>
</riaControls:DomainDataSource>

<nisbus:ReferenceDataForm x:Name="MyForm"
DomainDataSource="{Binding dds}"
DisplayPropertyName="Name"
VerticalAlignment="Top"
AutoGenerateFields="True"
CommandButtonsVisibility="Cancel, Add,Commit,Delete"
HorizontalContentAlignment="Left"/>
</Grid>

Sorry I don't know how to apply code formatting to this text.

Please check out the original dataform from the Silverlight Toolkit here: http://silverlight.codeplex.com

Last edited Oct 11, 2009 at 12:06 PM by nisbus, version 4