We are using MVVM and want to keep all the binding and logic in the view model. All of your examples are with code behind. So, is there a way to define the parent and child in xaml and then do the binding in the view model?
Forgot to add that we also use a collection of Business Objects to bind to and not data sets.
The code below displays the child detail and it has all the objects columns list, but no data?
Thanks
Xaml Code:
Code Behind:
Forgot to add that we also use a collection of Business Objects to bind to and not data sets.
The code below displays the child detail and it has all the objects columns list, but no data?
Thanks
Xaml Code:
<telerik:RadGridView.Columns> |
<telerik:GridViewDataColumn |
HeaderText="Policy Number" |
UniqueName ="PolicyNumber" |
> |
<telerik:GridViewColumn.CellTemplate> |
<DataTemplate> |
<TextBox |
HorizontalContentAlignment="Stretch" |
Text="{Binding Path=PolicyNumber, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" |
HorizontalAlignment="Left" VerticalAlignment="Top" /> |
</DataTemplate> |
</telerik:GridViewColumn.CellTemplate> |
</telerik:GridViewDataColumn> |
<telerik:GridViewDataColumn |
HeaderText="Insurance Name" |
UniqueName ="InsuranceName" |
> |
<telerik:GridViewColumn.CellTemplate> |
<DataTemplate> |
<TextBlock |
Text="{Binding Path=InsuranceName}" |
HorizontalAlignment="Left" VerticalAlignment="Top" /> |
</DataTemplate> |
</telerik:GridViewColumn.CellTemplate> |
</telerik:GridViewDataColumn> |
</telerik:RadGridView.Columns> |
<telerik:GridViewDataControl.HierarchyChildTemplate> |
<DataTemplate> |
<StackPanel> |
<telerik:RadGridView |
CanUserReorderColumns="False" |
CanUserFreezeColumns="False" |
ShowGroupPanel="False" |
ColumnsWidthMode="Auto" |
ItemsSource="{Binding Path=InsuranceProvider}" |
> |
</telerik:RadGridView> |
</StackPanel> |
</DataTemplate> |
</telerik:GridViewDataControl.HierarchyChildTemplate> |
</telerik:RadGridView> |
Code Behind:
Public Sub New() |
InitializeComponent() |
Dim InsProvDetailDefinition As New GridViewTableDefinition() |
InsProvDetailDefinition.Relation = New PropertyRelation("InsuranceProvider") |
Me.RadPatInsList.TableDefinition.ChildTableDefinitions.Add(InsProvDetailDefinition) |
End Sub |