Hi,
We have a series of views consisting of a search box, search options and then a results RadGridView. Since the functionality & bindings is the same on each, we have a UserControl that holds the search box & search options functionality. The only difference between each view is the Columns in RadGridView, so we are trying to put the RadGridView inside the UserControl and allow the columns to be specified by the implementing view.
Do you know how we could achieve this?
Roughly what we're trying to do:
<UserControl x:Class="UserControls.BaseSearch"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
Height="Auto" Width="Auto">
<Grid>
<telerik:RadGridView Margin="0" Name="radGridView1" ItemsSource="{Binding SearchResults}" />
</Grid>
</UserControl>
<UserControl x:Class="Views.CustomerSearch"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
xmlns:userControls="http://schemas.telerik.com/2008/xaml/presentation"
Height="Auto" Width="Auto">
<Grid>
<userControls:BaseSearch>
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn Header="Reference"
Name="Reference"
DataMemberBinding="{Binding Reference}" Width="100">
</telerik:GridViewDataColumn>
<telerik:GridViewDataColumn Header="Description"
DataMemberBinding="{Binding Description}"
Width="200" />
<telerik:GridViewDataColumn Header="Start Date"
DataMemberBinding="{Binding StartDate, StringFormat=d}"
ShowDistinctFilters="False"
Width="130" />
</telerik:RadGridView.Columns>
</userControls:BaseSearch>
</Grid>
</UserControl>