I have a button inside the RadExpander and have the command property as well. However I am getting the error in the output saying the command property is not found in my view model. I have set the relative source to the rad expander as well.
The thing is I have the button inside the Rad Expander header and have the command property and it is working perfectly.
I am using Prism Framework with MEF.
Please see below the code,
<telerik:RadExpander Grid.Row="0" Margin="5" >
<telerik:RadExpander.Header>
<Grid>
<telerik:RadButton Margin="0,0,10,0" Style="{DynamicResource RadImageButton}"
Command="{Binding Path=DataContext.CollapseCommand, RelativeSource={RelativeSource FindAncestor, AncestorType=telerikinput:RadExpander}}"
Visibility="{Binding Converter={StaticResource VisibilityConverter}, Path=IsHeaderExpand}">
</telerik:RadButton>
<telerik:RadButton Margin="0,0,10,0" Style="{DynamicResource RadImageButton}"
Command="{Binding Path=DataContext.ExpandCommand,RelativeSource={RelativeSource FindAncestor, AncestorType=telerikinput:RadExpander}}"
Visibility="{Binding Converter={StaticResource VisibilityConverter}, Path=IsCollapse}">
</telerik:RadButton>
<Label Content="Search Criteria" Margin="40,10,0,0" Style="{DynamicResource LabelBoldContentStyle}" HorizontalAlignment="Left"/>
</Grid>
</telerik:RadExpander.Header>
<Grid Margin="5">
<Button Grid.Row="7" Grid.Column="7" Height="28" Width="50" Margin="0,0,46,0"
Content="Search" HorizontalAlignment="Right" FontWeight="Bold"
Command="{Binding Path=DataContext.SearchComamnd, RelativeSource={RelativeSource FindAncestor, AncestorType=telerik:RadExpander}}"/>
</Grid>
Please let me know what I am missing in my code ?
Thnx,
Sivakumar