I am trying to place to buttons in the expander header but I want them to be aligned to the right side of the expander header. However, the contents of the header do not take up the entire size of the header, they only take up the minimum space necessary to draw the controls in the header.
Here is what I have:
<telerik:RadExpander>
<telerik:RadExpander.Header>
<Grid Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="5*"/>
<ColumnDefinition Width="5*"/>
</Grid.ColumnDefinitions>
<Button HorizontalAlignment="Left" Content="Click Me" />
<Button Grid.Column="1" HorizontalAlignment="Right" Content="Click Me" />
</Grid>
</telerik:RadExpander.Header>
<TextBlock Text="This is a test of the telerik expander control." />
</telerik:RadExpander>
So I get
\/ Click Me Click Me
This is a test of the telerik expander control
And I want this
\/ Click Me Click Me
This is a test of the telerik expander control
I can get it to work with the following hack but I was hoping this would not be necessary.
<Grid>
<TextBox Margin="30,0,0,0" Height="1" Name="_hiddenWidthControl" />
<telerik:RadExpander IsExpanded="True">
<telerik:RadExpander.Header>
<StackPanel Width="{Binding ElementName=_hiddenWidthControl, Path=ActualWidth}">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<Button HorizontalAlignment="Right" Content="Click Me" />
<Button Grid.Column="1" HorizontalAlignment="Right" Content="Click Me" />
</StackPanel>
</StackPanel>
</telerik:RadExpander.Header>
<TextBlock Text="This is a test of the telerik expander control." />
</telerik:RadExpander>
</Grid>
Thanks,
Billy Jacobs