TextBox in RadGridViewColumn IN WPF - wpf

There is a textbox in the gridviewColumn And a ComboBox in the other column In need to set the TextBox read only true and readOnly False On the section On COmboBox.
<telerik:GridViewDataColumn x:Name="requstamount" Header="Request Amount" Width="200">
<telerik:GridViewColumn.CellTemplate >
<DataTemplate>
<TextBox IsEnabled="{Binding IsTextBoxEnabled, StringFormat=c, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
Name="txtPaymentAMNT"
Text="{Binding PaymentAmount, StringFormat=c, UpdateSourceTrigger=PropertyChanged}"
Background="Transparent"
LostFocus="text_LostFocus"
BorderBrush="LightGray"
BorderThickness="0,0,0,3"
Width="141"
Margin="-5,0,0,0" />
</DataTemplate>
</telerik:GridViewColumn.CellTemplate>
</telerik:GridViewDataColumn>
<telerik:GridViewDataColumn Header="Request Type" Width="150">
<telerik:GridViewColumn.CellTemplate >
<DataTemplate>
<telerik:RadComboBox x:Name="cboType"
Background="Transparent"
HorizontalAlignment="Left"
BorderBrush="blue"
BorderThickness="0,0,0,1"
Margin="-5,0,0,0"
telerik:StyleManager.Theme="Office2019"
Width="100"
Height="25"
SelectedIndex="{Binding Path=Reqsttype, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
SelectionChanged="cmbType_SelectionChanged"
SelectedValuePath="{Binding OrderNo}">
<telerik:RadComboBoxItem Name="Pre_Auth" IsSelected="True">
Pre-Auth
</telerik:RadComboBoxItem>
<telerik:RadComboBoxItem Name="Deposit">
Deposit
</telerik:RadComboBoxItem>
</telerik:RadComboBox>
</DataTemplate>
</telerik:GridViewColumn.CellTemplate>
</telerik:GridViewDataColumn>

Related

WPF:- How to create a Treeview control with combo box, check box and text box in it using MVVM

I'm trying to put a ComboBox, a checkbox and a few textboxes inside a treeview in WPF.
Following is the basic structure of the treeview requirement
-Parent
--Label Textbox
--Label Textbox
--Label Textbox
--Label Combo box
--Label Check box
--Payload
---Label
----Label Textbox
----Label Combobox
----Label Textbox
Following is the xaml code
<TreeView x:Name="BTreeView" Grid.Column="1" Grid.Row="1" Margin="1,10,0,10" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ItemsSource="{Binding TreeViewListings}" >
<TreeView.Resources>
<HierarchicalDataTemplate DataType="{x:Type viewmodel:TreeViewBViewModel}" ItemsSource="{Binding Positions}" >
<TextBlock Text="Level1"/>
<HierarchicalDataTemplate.ItemTemplate>
<HierarchicalDataTemplate ItemsSource="{Binding PayLoadList}" DataType="{x:Type viewmodel:Position}">
<StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Text 1" />
<TextBox Text="{Binding Path=Text1, UpdateSourceTrigger=PropertyChanged}" Width="200" Margin="10,0,0,0" BorderThickness="0" HorizontalAlignment="Left"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Text 2" />
<TextBox Text="{Binding Path=Text1, UpdateSourceTrigger=PropertyChanged}" Width="200" Margin="10,0,0,0" BorderThickness="0" HorizontalAlignment="Left"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Text 3"/>
<ComboBox Width="100" Height="18" Margin="10,0,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" FontSize="10" IsEditable="True" IsReadOnly="True" BorderThickness="0">
<ComboBoxItem IsSelected="True">Item 1</ComboBoxItem>
<ComboBoxItem>Item 2</ComboBoxItem>
<ComboBoxItem>Item 3</ComboBoxItem>
<ComboBoxItem>Item 4</ComboBoxItem>
<ComboBoxItem>Item 5</ComboBoxItem>
</ComboBox>
</StackPanel>
<StackPanel Orientation="Horizontal">
<CheckBox Canvas.Left="10" Canvas.Top="10" Content="Active" IsChecked="False"/>
</StackPanel>
<TextBlock Text="{Binding PayLoadText}"/>
</StackPanel>
<HierarchicalDataTemplate.ItemTemplate>
<HierarchicalDataTemplate ItemsSource="{Binding PayLoadData}" DataType="{x:Type viewmodel:Payload}">
<Label Content="{Binding FieldName}"/>
<HierarchicalDataTemplate.ItemTemplate>
<DataTemplate DataType="{x:Type viewmodel:PayloadData}">
<StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Text 4" />
<TextBox Text="{Binding Path=Text4, UpdateSourceTrigger=PropertyChanged}" Width="200" Margin="10,0,0,0" BorderThickness="0" HorizontalAlignment="Left"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Data}" />
<TextBox Text="{Binding Path=DataFieldValue, UpdateSourceTrigger=PropertyChanged}" Width="200" BorderThickness="0" HorizontalAlignment="Left"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Operation" />
<ComboBox Width="100" Height="18" Margin="10,0,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" FontSize="10" IsEditable="True" IsReadOnly="True" BorderThickness="0">
<ComboBoxItem>Item 1</ComboBoxItem>
<ComboBoxItem>Item 2</ComboBoxItem>
<ComboBoxItem>Item 3</ComboBoxItem>
<ComboBoxItem>Item 4</ComboBoxItem>
</ComboBox>
</StackPanel>
</StackPanel>
</DataTemplate>
</HierarchicalDataTemplate.ItemTemplate>
</HierarchicalDataTemplate>
</HierarchicalDataTemplate.ItemTemplate>
</HierarchicalDataTemplate>
</HierarchicalDataTemplate.ItemTemplate>
</HierarchicalDataTemplate>
</TreeView.Resources>
</TreeView>
I am using MVVM architectural pattern to achieve this goal. The problem that I am facing is with the arrow head of second level node. It is not aligned at the right position. The arrowhead gets automatically aligned to "Text3" combo box instead of "Payload" node. Following is the image of my tree view
I do not know if there is any other approach to include Combo box, check box, text boxes inside a treeview using MVVM approach. Would appreciate if you let me know your approach of designing this treeview

Accessing Telerik Silverlight RadGridView from Button on Group header

I have a RadGridView, that groups its contents.
I have a Button on the group header
When I click on the button (btnSave) I would like to get access to the group to read the group key.
What can I put in the Click of btnSave to accomplish this?
<telerik:RadGridView x:Name="grdNotams" Grid.Row="1" AutoGenerateColumns="False" RowIndicatorVisibility="Collapsed" ShowGroupPanel="False">
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn UniqueName="colNewStatus" DataMemberBinding="{Binding NewStatus}" Header="New Status" IsFilterable="False" IsSortable="False">
<telerik:GridViewDataColumn.CellTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<telerik:RadRadioButton Content="C" Width="30" IsChecked="{Binding NewStatus, Mode=TwoWay, Converter={StaticResource StringToBooleanConverter},ConverterParameter=C}" GroupName="{Binding RadioButtonName}"/>
<telerik:RadRadioButton Content="M" Width="30" Margin="5,0,0,0" IsChecked="{Binding NewStatus, Mode=TwoWay, Converter={StaticResource StringToBooleanConverter},ConverterParameter=M}" GroupName="{Binding RadioButtonName}"/>
<telerik:RadRadioButton Content="I" Width="30" Margin="5,0,0,0" IsChecked="{Binding NewStatus, Mode=TwoWay, Converter={StaticResource StringToBooleanConverter},ConverterParameter=I}" GroupName="{Binding RadioButtonName}"/>
</StackPanel>
</DataTemplate>
</telerik:GridViewDataColumn.CellTemplate>
</telerik:GridViewDataColumn>
<telerik:GridViewDataColumn Header="Status" UniqueName="colStatus" DataMemberBinding="{Binding Model.Status, Converter={StaticResource StatusConverter}}" HeaderTextAlignment="Center" TextAlignment="Center" IsFilterable="False" IsSortable="False"/>
<telerik:GridViewDataColumn Header="Trip #" UniqueName="colTripNumber" DataMemberBinding="{Binding Model.TripNumber}" HeaderTextAlignment="Center" TextAlignment="Center" IsFilterable="False" IsSortable="False"/>
<telerik:GridViewDataColumn Header="Date" UniqueName="colDate" DataMemberBinding="{Binding Model.DepartureTime}" DataFormatString="d" HeaderTextAlignment="Center" TextAlignment="Center" IsFilterable="False" IsSortable="False"/>
</telerik:RadGridView.Columns>
<telerik:RadGridView.GroupHeaderTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<telerik:RadButton x:Name="btnSave" Click="btnSave_Click">
<StackPanel Orientation="Vertical">
<Image Source="../images/save.jpg" Height="30" Width="30" HorizontalAlignment="Center"/>
<TextBlock TextAlignment="Center" TextWrapping="Wrap">Update</TextBlock>
</StackPanel>
</telerik:RadButton>
<TextBlock Text="{Binding Group.Key}" FontSize="14" FontWeight="Bold" FontStyle="{Binding EarliestNotamDepartureTime, Converter={StaticResource DateTimeToItalicsConverter}}" TextWrapping="Wrap" VerticalAlignment="Center" Padding="5"/>
</StackPanel>
</DataTemplate>
</telerik:RadGridView.GroupHeaderTemplate>
<telerik:RadGridView.GroupDescriptors>
<telerik:GroupDescriptor Member="NotamGroup" >
</telerik:GroupDescriptor>
<telerik:GroupDescriptor Member="Model.NotamText">
</telerik:GroupDescriptor>
</telerik:RadGridView.GroupDescriptors>
</telerik:RadGridView>
Figured it out.
The DataContext has the information I needed in the form of the GroupViewModel class.
Code
private void btnSave_Click(object sender, RoutedEventArgs e)
{
GroupViewModel vm = ((RadButton)sender).DataContext as GroupViewModel;
}

How do I put a header on the ItemsControl?

I want to show a product list with a header like a DataGrid. But I don't know how to show heading in the listbox.
<ListBox ItemsSource="{Binding CustomSalesProducts, Mode=TwoWay}" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Template="{DynamicResource ListBox}" Style="{DynamicResource ListBoxStyle1}" BorderBrush="{DynamicResource BorderBrush}" Foreground="{DynamicResource ForegroundBrush}" FontFamily="Palatino Linotype" FontSize="13.333" ItemContainerStyle="{DynamicResource ListBoxItemStyle}" SelectedValue="{Binding CurrentCustomSale, Mode=TwoWay}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel CanHorizontallyScroll="True" CanVerticallyScroll="True" Orientation="Vertical"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel>
<StackPanel Orientation="Horizontal">
<TextBox Text="{Binding ProductName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Margin="{StaticResource Margin4}" Style="{DynamicResource MiniTextBoxStyle}" ToolTip="Quantity" KeyUp="TextBox_KeyUp"/>
<TextBox Text="{Binding OrderQty, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Margin="{StaticResource Margin4}" Style="{DynamicResource MiniTextBoxStyle}" ToolTip="Quantity" KeyUp="TextBox_KeyUp">
</TextBox>
<TextBox Text="{Binding UnitSalePrice, Mode=TwoWay}" Style="{DynamicResource MiniTextBoxStyle}" Margin="{StaticResource Margin4}" ToolTip="Price" IsReadOnly="True" />
<TextBox Text="{Binding MainDiscount, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Margin="{StaticResource Margin4}" Style="{DynamicResource MiniTextBoxStyle}" ToolTip="Discount" KeyUp="TextBox_KeyUp"/>
<TextBox Text="{Binding Discount, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Margin="{StaticResource Margin4}" IsReadOnly="True" Style="{DynamicResource MiniTextBoxStyle}" ToolTip="Line Discount" KeyUp="TextBox_KeyUp"/>
<TextBox Text="{Binding TaxAmount, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Margin="{StaticResource Margin4}" Style="{DynamicResource MiniTextBoxStyle}" ToolTip="Tax Amount" IsReadOnly="True" />
<TextBox Text="{Binding LineTotal, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Margin="{StaticResource Margin4}" Style="{DynamicResource MiniTextBoxStyle}" ToolTip="Total" IsReadOnly="True" />
</StackPanel>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ListBox>
I want this kind of output
--------------------------------------
ID Name Price Discount
1 xxxx 1245 8
2 xxxxxxxx 4354 9
..... and so on..
I think what you really whant is a ListView with a GridView view.
<ListView ItemsSource="{Binding Source=
{StaticResource EmployeeInfoDataSource}}">
<ListView.View>
<GridView AllowsColumnReorder="true"
ColumnHeaderToolTip="Employee Information">
<GridViewColumn DisplayMemberBinding=
"{Binding Path=FirstName}"
Header="First Name" Width="100"/>
<GridViewColumn DisplayMemberBinding=
"{Binding Path=EmployeeNumber}"
Header="Employee No." Width="100"/>
</GridView>
</ListView.View>
</ListView>

WPF 3.5 nested datagrid row details not showing in Visual Tree

So I build a nice nested datagrid that look something like this:
<dg:DataGrid x:Name="mainGrid"
AutoGenerateColumns="False"
CanUserAddRows="False"
AreRowDetailsFrozen="True"
CanUserReorderColumns="False"
CanUserResizeColumns="True"
CanUserResizeRows="False"
SelectionUnit="FullRow"
RowDetailsVisibilityMode="VisibleWhenSelected">
<dg:DataGrid.Columns>
<dg:DataGridTemplateColumn CanUserResize="False" CanUserSort="False" Width="36" IsReadOnly="False">
<dg:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button Content="+" Width="28" Height="28" />
</DataTemplate>
</dg:DataGridTemplateColumn.CellTemplate>
</dg:DataGridTemplateColumn>
<dg:DataGridTemplateColumn>
<dg:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Grid>
<CheckBox IsChecked="{Binding IsSelected, Mode=TwoWay}"/>
</Grid>
</DataTemplate>
</dg:DataGridTemplateColumn.CellTemplate>
</dg:DataGridTemplateColumn>
<dg:DataGridTemplateColumn Header="Name" IsReadOnly="True" Width="582">
<dg:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="5" VerticalAlignment="Center" Text="{Binding Name, Mode=TwoWay, UpdateSourceTrigger=Default}" />
</DataTemplate>
</dg:DataGridTemplateColumn.CellTemplate>
</dg:DataGridTemplateColumn>
<dg:DataGridTemplateColumn Header="Status" IsReadOnly="True" Width="150">
<dg:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="5" VerticalAlignment="Center" Text="{Binding Status, Mode=TwoWay, UpdateSourceTrigger=Default}" />
</DataTemplate>
</dg:DataGridTemplateColumn.CellTemplate>
</dg:DataGridTemplateColumn>
<dg:DataGridCheckBoxColumn Binding="{Binding IsSelected}"/>
</dg:DataGrid.Columns>
<dg:DataGrid.RowDetailsTemplate>
<DataTemplate>
<dg:DataGrid x:Name="scondaryDatagrid" Margin="29,0,0,0"
AutoGenerateColumns="False"
CanUserAddRows="False"
AreRowDetailsFrozen="True"
CanUserReorderColumns="False"
CanUserResizeColumns="True"
CanUserResizeRows="False"
SelectionUnit="Cell"
RowDetailsVisibilityMode="VisibleWhenSelected"
ItemsSource="{Binding Grades, Mode=TwoWay}">
<dg:DataGrid.Columns>
<dg:DataGridTemplateColumn CanUserResize="False" CanUserSort="False" Width="32" IsReadOnly="True">
<dg:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button Content="+" Width="28" Height="28" />
</DataTemplate>
</dg:DataGridTemplateColumn.CellTemplate>
</dg:DataGridTemplateColumn>
<dg:DataGridTemplateColumn CanUserResize="False" CanUserSort="False" Width="32" IsReadOnly="True">
<dg:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<CheckBox IsChecked="{Binding IsSelected, Mode=TwoWay}" VerticalAlignment="Center" HorizontalAlignment="Center" HorizontalContentAlignment="Center" />
</DataTemplate>
</dg:DataGridTemplateColumn.CellTemplate>
</dg:DataGridTemplateColumn>
<dg:DataGridTemplateColumn Header="Name" IsReadOnly="True" Width="550">
<dg:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="5" Text="{Binding Name, Mode=TwoWay}" VerticalAlignment="Center" />
</DataTemplate>
</dg:DataGridTemplateColumn.CellTemplate>
</dg:DataGridTemplateColumn>
</dg:DataGrid.Columns>
<dg:DataGrid.RowDetailsTemplate>
<DataTemplate>
<dg:DataGrid Margin="25,0,0,0"
AutoGenerateColumns="False"
CanUserAddRows="False"
AreRowDetailsFrozen="True"
CanUserReorderColumns="False"
CanUserResizeColumns="True"
CanUserResizeRows="False"
SelectionUnit="Cell"
ItemsSource="{Binding Notes, Mode=TwoWay}">
<dg:DataGrid.Columns>
<dg:DataGridTemplateColumn CanUserResize="False" CanUserSort="False" Width="32" IsReadOnly="True">
<dg:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<CheckBox IsChecked="{Binding IsSelected, Mode=TwoWay}" VerticalAlignment="Center" HorizontalAlignment="Center" />
</DataTemplate>
</dg:DataGridTemplateColumn.CellTemplate>
</dg:DataGridTemplateColumn>
<dg:DataGridTemplateColumn Header="Note" IsReadOnly="True" Width="550">
<dg:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="5" Text="{Binding Note, Mode=TwoWay}" VerticalAlignment="Center" />
</DataTemplate>
</dg:DataGridTemplateColumn.CellTemplate>
</dg:DataGridTemplateColumn>
</dg:DataGrid.Columns>
</dg:DataGrid>
</DataTemplate>
</dg:DataGrid.RowDetailsTemplate>
</dg:DataGrid>
</DataTemplate>
</dg:DataGrid.RowDetailsTemplate>
</dg:DataGrid>
Due to the RowDetailsVisibilityMode property when it is set to VisibleWhenSelected, the Node DataGridDetailsPresenter for the rows have 0 children. When the property is set to Visible I can see the DataGridDetailsPresenter children.
How can I force the inclusion of all the nodes in the Visual tree for when the RowDetailsVisibilityMode property is VisibleWhenSelected?
Any input is greatly appreciated.
What are you trying to accomplish?
Unless the the RowDetails are visible they would not be in the Visual Tree unless could force their creation by setting the RowDetailsVisibilityMode to Visible but setting the RowDetails DataGrid visibility to Collapsed. This may not work. I don't know if the DataGrid would be in the Visual Tree if set to Collapsed in 3.5.

Can't bind child collection in silverlight

I have a pretty simple setup that I cannot get to work in silverlight. I have an order with a collection of OrderPayments. These objects are part of a Entity Framework model and are exposed through WCF RIA Services. I can bind perfectly fine to any basic property on the Order class, but I wanted to bind to a listbox to show the OrderPayments. Here's the XAML for the ListBox.
<ListBox ItemsSource="{Binding Data.OrderPayments, ElementName=orderDataSource}"></ListBox>
Nothing ever appears in the listbox and there is at least one OrderPayment for the order displayed. orderDataSource is a DomainDataSource that contains the Order. The odd thing about this is that I don't receive any binding errors and when I bind to a TextBlock using the following code:
<TextBlock Text="{Binding Data.OrderPayments, ElementName=orderDataSource}" />
The text 'OrderPayment' is outputted to the screen. Is there something different I have to do to get Silverlight to actually pick up the reference to the object?
Entire XAML below:
<riaControls:DomainDataSource AutoLoad="True" Name="orderDataSource" QueryName="GetOrder">
<riaControls:DomainDataSource.QueryParameters>
<riaControls:Parameter ParameterName="orderid" Value="1" />
</riaControls:DomainDataSource.QueryParameters>
<riaControls:DomainDataSource.DomainContext>
<ds:CEWCPSDomainContext />
</riaControls:DomainDataSource.DomainContext>
</riaControls:DomainDataSource>
<StackPanel Orientation="Vertical" Margin="12">
<StackPanel Orientation="Horizontal">
<Button Width="100" Height="50" Content="Save & Return" Margin="0,0,12,12" />
<Button Width="100" Height="50" Content="Orders" Margin="0,0,12,12" />
<Button Width="100" Height="50" Content="Emails" Margin="0,0,12,12" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<dataForm:DataForm x:Name="dataForm1" Header="Order Contact Information"
AutoGenerateFields="False" AutoEdit="False" AutoCommit="False"
CurrentItem="{Binding Data, ElementName=orderDataSource}">
<dataForm:DataForm.EditTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<StackPanel>
<dataForm:DataField Label="First Name">
<TextBox Text="{Binding FirstName, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnExceptions=True }" />
</dataForm:DataField>
<dataForm:DataField Label="Last Name">
<TextBox Text="{Binding LastName, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnExceptions=True }"/>
</dataForm:DataField>
<dataForm:DataField Label="Organization">
<TextBox Text="{Binding Organization, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnExceptions=True }"/>
</dataForm:DataField>
<dataForm:DataField Label="Phone">
<TextBox Text="{Binding Phone, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnExceptions=True }"/>
</dataForm:DataField>
<dataForm:DataField Label="Fax">
<TextBox Text="{Binding Fax, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnExceptions=True }"/>
</dataForm:DataField>
<dataForm:DataField Label="Email">
<TextBox Text="{Binding Email, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnExceptions=True }"/>
</dataForm:DataField>
<dataForm:DataField Label="Address 1">
<TextBox Text="{Binding Address1, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnExceptions=True }"/>
</dataForm:DataField>
<dataForm:DataField Label="Address 2">
<TextBox Text="{Binding Address2, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnExceptions=True }"/>
</dataForm:DataField>
<dataForm:DataField Label="City">
<TextBox Text="{Binding City, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnExceptions=True }"/>
</dataForm:DataField>
<dataForm:DataField Label="State">
<TextBox Text="{Binding State, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnExceptions=True }"/>
</dataForm:DataField>
<StackPanel Orientation="Horizontal" Width="Auto">
<dataForm:DataField Label="Zip code">
<TextBox Text="{Binding Zip, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnExceptions=True }"/>
</dataForm:DataField>
<dataForm:DataField>
<TextBox Text="{Binding Zip4, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnExceptions=True }"/>
</dataForm:DataField>
</StackPanel>
<dataForm:DataField Label="Country">
<TextBox Text="{Binding Country, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnExceptions=True }"/>
</dataForm:DataField>
</StackPanel>
</StackPanel>
</DataTemplate>
</dataForm:DataForm.EditTemplate>
</dataForm:DataForm>
<StackPanel Orientation="Vertical">
<TextBlock FontWeight="Bold" FontSize="16" Text="Order Total / Payments" />
<TextBlock >
<Run Text="Order Total:" />
<Run Text="{Binding Data.OrderTotal, ElementName=orderDataSource}" />
</TextBlock>
<TextBlock Text="Payments" />
<TextBlock Text="{Binding Data.OrderPaymentItems, ElementName=orderDataSource}" />
<ListBox ItemsSource="{Binding Data.OrderPayments, ElementName=orderDataSource}">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Amount}" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</StackPanel>
</StackPanel>
</StackPanel>
WCF RIA Services does not include child entities by default. I needed to put [Include()] on the OrderPayments property of the Order object. Works like a charm now.

Resources