Hi ,
My end goal is to do something similar to a ItemSource Control and dynamically switch out the the Column defintions
for a Grid. In the below Xaml, there are two DataTemplates. I would like to be able to switch out the between MyTemplateOne and
MyTemplateTwo, by setting the ItemTemplate property on the RadGridView. Of course this does not work. Is there some other way way to do this?
Something, that does work is a the RowDetailsTemplate property :
RowDetailsTemplate="{StaticResource EmployeeInfoRowDetailsTemplate}"
But I would like to do the same on the regular Rows.
Thanks, Matt
My end goal is to do something similar to a ItemSource Control and dynamically switch out the the Column defintions |
for a Grid. In the below Xaml, there are two DataTemplates. I would like to be able to switch out the between MyTemplateOne and |
MyTemplateTwo, by setting the ItemTemplate property on the RadGridView. Of course this does not work. Is there some other way way to do this? |
Something, that does work is a the RowDetailsTemplate property : |
RowDetailsTemplate="{StaticResource EmployeeInfoRowDetailsTemplate}" |
But I would like to do the same on the regular Rows. |
Thanks, Matt |
<UserControl.Resources> |
<DataTemplate Key = "MyTemplateOne" > |
<telerikGridView:RadGridView.Columns> |
<telerikGridView:GridViewDataColumn DataMemberBinding="{Binding ContractYearID}" /> |
<telerikGridView:GridViewDataColumn DataMemberBinding="{Binding ContractYearDescription}"/> |
<telerikGridView:GridViewDataColumn DataMemberBinding="{Binding YearStartDate}"/> |
<telerikGridView:RadGridView.Columns> |
</DataTemplate> |
<DataTemplate Key = "MyTemplateTwo" > |
<telerikGridView:RadGridView.Columns> |
<telerikGridView:GridViewDataColumn DataMemberBinding="{Binding ContractYearID}" /> |
<telerikGridView:GridViewDataColumn DataMemberBinding="{Binding ContractYearDescription}"/> |
<telerikGridView:GridViewDataColumn DataMemberBinding="{Binding YearStartDate}"/> |
<telerikGridView:GridViewDataColumn DataMemberBinding="{Binding YearEndDate}"/> |
<telerikGridView:GridViewDataColumn DataMemberBinding="{Binding ContractAmount}"/> |
<telerikGridView:RadGridView.Columns> |
</DataTemplate> |
</UserControl.Resources> |
<telerikGridView:RadGridView> |
AutoGenerateColumns="False" |
ItemsSource="{Binding ContractYears, Mode=OneWay}" |
ItemTemplate="MyTemplateOne" OR "MyTemplateTwo" |
DataLoadMode="Asynchronous"/> |
</telerikGridView:RadGridView> |
<UserControl> |