This is a migrated thread and some comments may be shown as answers.

button inside header of telerik rad expander is not working on first click?

1 Answer 158 Views
Expander
This is a migrated thread and some comments may be shown as answers.
sri hari
Top achievements
Rank 1
sri hari asked on 11 Dec 2012, 07:20 AM

I am getting issue with telerik rad expander which contains button inside header. it is working as usual when i expand or collapse but after clicking button inside header, it is not expanding or collapsing for 1st time and it is expanding or collapsing on 2nd click of radexpander. I am using version VS2010 + silverlight 4 + telerik contorls Q1 2012 . I am not getting why it is behaving when i click on button inside rad expander header and can any one try this attached code snippet which i tried and tell me how to resolve this issue?

 <Grid x:Name="LayoutRoot" Background="White">
        <StackPanel >
        <telerik:RadExpander IsExpanded="False"   Style="{StaticResource RadExpanderStyle}" >
            <telerik:RadExpander.Header>
                <StackPanel  Height="35" VerticalAlignment="Bottom" Orientation="Horizontal">
                    <Button x:Name="btnView" Click="btnView_Click"   Content="View" HorizontalAlignment="Left" VerticalAlignment="Center" Width="70" Style="{StaticResource ButtonStyle}" Margin="0,0,10,0"/>
                    <Button x:Name="btnPrint" Click="btnPrint_Click"  Content="Print" HorizontalAlignment="Left" VerticalAlignment="Center" Width="70" Style="{StaticResource ButtonStyle}" Margin="0,0,10,0"/>
                </StackPanel>
            </telerik:RadExpander.Header>
            <TextBlock Text="welcomeeeeeeeeeeeeeeeee............." FontSize="18"/>
        </telerik:RadExpander>
        </StackPanel>
    </Grid>

1 Answer, 1 is accepted

Sort by
0
Kiril Vandov
Telerik team
answered on 13 Dec 2012, 01:30 PM
Hello sri hari,

The behavior  you are experiencing is expected as our RadExpander Header consists of a ToggleButton and that is how the framework works in that kind of situation. The RadExpander.Header is not expected to put any Buttons or a TextBox. You could try use the default controls and the effect will be the same here is a code snippet:
<ToggleButton  Padding="20">
    <Button  Content="Inner" />
</ToggleButton>
Once pressed the inner button the parent one will be activated after two clicks.
As for a work around you could make custom template for the expander, placing the toggle button and the header content side by side not on top of each other as the default template.

I hope this information works.

Regards,
Kiril Vandov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Expander
Asked by
sri hari
Top achievements
Rank 1
Answers by
Kiril Vandov
Telerik team
Share this question
or