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

2 posts, 0 answers
  1. sri hari
    sri hari avatar
    4 posts
    Member since:
    Apr 2010

    Posted 11 Dec 2012 Link to this post

    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>
  2. Kiril Vandov
    Admin
    Kiril Vandov avatar
    324 posts

    Posted 13 Dec 2012 Link to this post

    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.

  3. DevCraft banner
Back to Top