Expander Content is not Visible while expanding.

2 posts, 0 answers
  1. Iden
    Iden avatar
    5 posts
    Member since:
    Jan 2013

    Posted 28 Jan 2013 Link to this post

    I have done grouping in the Telerik Gridview,My task is to Alter the header of the Group item at the run time , So i have implemented the below Code while clicking on the Expander i could able to get the content Nothing is displayed. 
    Please help me on this 

     <telerik:RadGridView x:Name="telerikGrid" ItemsSource="{Binding Path=Collection}"  GridLinesVisibility="Horizontal" KeyboardNavigation.TabNavigation="Cycle" ShowGroupPanel="False"
     AutoGenerateColumns="False"  CanUserInsertRows="False" AutoExpandGroups="True" CanUserFreezeColumns="False" RowIndicatorVisibility="Collapsed" CanUserResizeColumns="False" CanUserSortColumns="True" CanUserReorderColumns="False" 
     MinHeight="360" MaxHeight="360" MaxWidth="880" MinWidth="880"  ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Visible">

    <Style TargetType="telerik:GridViewGroupRow">
                        <Setter Property="Background" Value="Red"/>
                        <Setter Property="BorderBrush" Value="Yellow"/>
                        <Setter Property="Template">
                                <ControlTemplate TargetType="{x:Type telerik:GridViewGroupRow}">
                                    <telerik:RadExpander IsExpanded="True" Background="#2A5581" BorderThickness="1,1,1,1">
                                                    <Rectangle Fill="White" Width="Auto" Margin="0,1,0,1" Stroke="Black"/>
                                                    <TextBlock Text="{Binding Path=TextName}" Margin="4,0,4,0" Grid.Column="0" Grid.Row="0" Foreground="Black"/>
                                                    <Rectangle Fill="Black" Width="Auto" Margin="0,1,0,1"/>
                                                    <TextBlock Text="{Binding Path=TextName}" Margin="4,0,4,0" Foreground="White" />

     <telerik:GridViewColumn  MaxWidth="40" MinWidth="40">

     <telerik:GridViewColumn  MaxWidth="40" MinWidth="40">

     <telerik:GridViewColumn  MaxWidth="40" MinWidth="40">


  2. Vanya Pavlova
    Vanya Pavlova avatar
    2019 posts

    Posted 31 Jan 2013 Link to this post

    Hello Arivarasu,

    Thank you for sharing this snippet with us! Actually this behavior is the expected one. If you take a look at the default template of GridViewGroupRow you may see different elements laid out in a specific manner, following some rules. They are bound to the corresponding ViewModel and it is not  straight forward to make it work using a single RadExpander. Since it is not a trivial task, I would like to suggest you to modify the default template of GridViewGroupRow and alter the ToggleButton elements to match the desired design presented in RadExpander, while preserving the UI logic of GridViewGroupRow.

    Vanya Pavlova
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top