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

[Solved] Hiding Expander column when using HierarchyChildTemplate

8 Answers 390 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
D. Omar
Top achievements
Rank 1
D. Omar asked on 06 Aug 2009, 06:17 PM
Is there a way to omit the expand/collapse column when using the HierarchyChildTemplate?

8 Answers, 1 is accepted

Sort by
0
Kalin Milanov
Telerik team
answered on 12 Aug 2009, 11:01 AM
Hello Omar,

The way to omit the expand/collapse column is via editing the template of the GridViewExpandableRow and remove / restyle the toggle button of the RadExpander.

I wonder, though, how will you be able to expand / collapse the hierarchy and whether or not an approach using RowDetails is more suitable for your scenario.

Let me know if you need any assistance with restyling.

Sincerely yours,
Kalin Milanov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
D. Omar
Top achievements
Rank 1
answered on 12 Aug 2009, 03:58 PM
To answer your question, I just assumed there is a way to do it programmatically and that I would create my own button or keyboard shortcut. Is my assumption wrong? Is there a way to programmatically expand the row?

As you can see in the thread that triggered this one:
http://www.telerik.com/community/forums/silverlight/gridview/getting-data-source-asynchronously-for-child-record-in-custom-hierarchy-gridview.aspx#908089


... I realized too late that RowDetails was a better alternative for what I am trying to do and I am on a tight schedule so switching to RowDetails is currently a lower priority task in my list but I will certainly make the change later, although it may not be until after the first release of our application.

The only help I need with the styling of the row right now is the location of the style the control uses out of the box.
0
Vlad
Telerik team
answered on 17 Aug 2009, 06:56 AM
Hi D. Omar,

Indeed currently you can expand hierarchy using ExpandableDataRecord:

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            ((ExpandableDataRecord) RadGridView1.Records[5]).IsExpanded = true;
        }

we will add also special method for expand to the GridViewDataControl since records will be removed for Q3.

Sincerely yours,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
James
Top achievements
Rank 1
answered on 28 Sep 2009, 06:22 AM
Hi Kalin,

I'm struggling to restyle the Expander button inside a GridViewExpandableRow template.

This is the xaml I get when I attempt to edit the template in Blend3:

                <Border x:Name="SelectionBackground" Margin="{TemplateBinding Margin}" MinHeight="{TemplateBinding MinHeight}" UseLayoutRounding="True" Grid.Column="2" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}"/>  
                <Rectangle x:Name="BackgroundRectangle" Fill="{StaticResource GridViewRowSelectedBackground}" Stroke="{x:Null}" StrokeThickness="1" Opacity="0" Grid.Column="2"/>  
                <Telerik_Windows_Controls_GridView:IndicatorPresenter x:Name="PART_IndicatorPresenter" Background="{StaticResource GridViewRowIndicatorBackground}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0,0,1,1" Visibility="{TemplateBinding RowIndicatorVisibility}" Grid.Column="0" telerik:StyleManager.Theme="{StaticResource Theme}">  
                    <Path x:Name="NavigatorIndicator" Fill="{StaticResource GridViewIndicatorsPartsFill}" Stretch="Fill" Height="8" HorizontalAlignment="Center" VerticalAlignment="Center" Width="5" Visibility="Collapsed" Data="M254.5,183.75 L254.5,193.33333 260.75,188.16682 z"/>  
                </Telerik_Windows_Controls_GridView:IndicatorPresenter> 
                <Telerik_Windows_Controls_GridView:IndentPresenter x:Name="PART_IndentPresenter" Background="{TemplateBinding Background}" Grid.Column="1" IndentLevel="{TemplateBinding IndentLevel}" telerik:StyleManager.Theme="{StaticResource Theme}"/>  
                <Telerik_Windows_Controls_GridView:HierarchyChildPresenter x:Name="PART_HierarchyChildPresenter" Foreground="{TemplateBinding Foreground}" Grid.Column="2" telerik:StyleManager.Theme="{StaticResource Theme}"/>  
                <Rectangle x:Name="InvalidBorder" Stroke="Red" StrokeThickness="2" Height="Auto" Margin="0" Width="Auto" Visibility="Collapsed" Grid.Column="0" Grid.ColumnSpan="3"/> 

Which part is the ToggleButton, or how am I able to set the RadExpander style?

I can see the RadExpander and associated ToggleButton in Silverlight Spy (inside HierarchyChildPresenter), but I'm unsure how to apply a template to it from the GridViewExpandableRow template, or anywhere else.

Thanks,
James.
0
James
Top achievements
Rank 1
answered on 29 Sep 2009, 06:49 AM
0
xusan Rahimov
Top achievements
Rank 1
answered on 02 Feb 2011, 04:50 PM
Hi Vlad I need to restyle column Header of GridViewToggleButton how to do that what style I need to create ?

Thanks
0
Vanya Pavlova
Telerik team
answered on 02 Feb 2011, 05:54 PM
Hello Xames,

 
You can get access to the GridViewToggleButton by editing the template of GridViewRow, please check the following link for further information. 

Greetings,
Vanya Pavlova
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
xusan Rahimov
Top achievements
Rank 1
answered on 02 Feb 2011, 10:05 PM
Hi Vanya thanks for your quick response but my problem is not ToggleButton
I have a style for HeaderCell like follow:

<Style TargetType="{x:Type telerik:GridViewHeaderCell}">
        <Setter
            Property="Background">
            <Setter.Value>
                <LinearGradientBrush
                    EndPoint="0.5,1"
                    StartPoint="0.5,0">
                    <GradientStop
                        Color="#FFDDE4EB"
                        Offset="0" />
                    <GradientStop
                        Color="#FFC3CFE0"
                        Offset="1" />
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter
            Property="Foreground"
            Value="#FF4E4E4E" />
        <Setter
            Property="Template"
            Value="{DynamicResource TelerikColumnHeaderControlTemplate}" />
        <Setter
            Property="BorderThickness"
            Value="0,0,1,0" />
        <Setter
            Property="Height"
            Value="35" />
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="Padding" Value="5,0"/>
    </Style>

Its applyed to all columns header perfectly but its not applied to header of tooglebutton column
please take a look on pic for more details

Thanks
Xusan.
Tags
GridView
Asked by
D. Omar
Top achievements
Rank 1
Answers by
Kalin Milanov
Telerik team
D. Omar
Top achievements
Rank 1
Vlad
Telerik team
James
Top achievements
Rank 1
xusan Rahimov
Top achievements
Rank 1
Vanya Pavlova
Telerik team
Share this question
or