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

Change "Drag column..." text

3 Answers 108 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Gilbert van Veen
Top achievements
Rank 1
Gilbert van Veen asked on 09 Aug 2010, 03:10 PM
<ControlTemplate x:Key="GridViewGroupPanelTemplate" TargetType="Telerik_Windows_Controls_GridView:GridViewGroupPanel">
            <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                <VisualStateManager.VisualStateGroups>
                    <VisualStateGroup x:Name="Grouping">
                        <VisualState x:Name="NoGroups"/>
                        <VisualState x:Name="HasGroups">
                            <Storyboard>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="panelText" Storyboard.TargetProperty="Visibility">
                                    <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Collapsed"/>
                                </ObjectAnimationUsingKeyFrames>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="panelTextGrouped" Storyboard.TargetProperty="Visibility">
                                    <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/>
                                </ObjectAnimationUsingKeyFrames>
                            </Storyboard>
                        </VisualState>
                    </VisualStateGroup>
                </VisualStateManager.VisualStateGroups>
                <Border Background="{TemplateBinding Background}" BorderBrush="{StaticResource GridView_GroupPanelInnerBorder}" BorderThickness="1">
                    <StackPanel Orientation="Horizontal">
                        <TextBlock x:Name="panelText" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" IsHitTestVisible="False" FontSize="9.5" telerik:LocalizationManager.ResourceKey="GridViewGroupPanelText" Text="Drag a column header and drop it here to group by that column 123"/>
                        <TextBlock x:Name="panelTextGrouped" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" IsHitTestVisible="False" Visibility="Collapsed" telerik:LocalizationManager.ResourceKey="GridViewGroupPanelTopTextGrouped"/>
                        <ItemsPresenter VerticalAlignment="Center"/>
                    </StackPanel>
                </Border>
            </Border>
        </ControlTemplate>
        <ItemsPanelTemplate x:Key="GridViewGroupPanelItemsPanelTemplate">
            <StackPanel VerticalAlignment="Stretch" Orientation="Horizontal"/>
        </ItemsPanelTemplate>
        <LinearGradientBrush x:Key="GridView_GroupPanelBackground" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#FFDFDFDF" Offset="1"/>
            <GradientStop Color="#FFBABABA"/>
        </LinearGradientBrush>
        <SolidColorBrush x:Key="GridView_GroupPanelOuterBorder" Color="#FF848484"/>
        <Style x:Key="GridViewGroupPanelStyle1" TargetType="Telerik_Windows_Controls_GridView:GridViewGroupPanel">
            <Setter Property="Template" Value="{StaticResource GridViewGroupPanelTemplate}"/>
            <Setter Property="ItemsPanel" Value="{StaticResource GridViewGroupPanelItemsPanelTemplate}"/>
            <Setter Property="MinHeight" Value="32"/>
            <Setter Property="Margin" Value="0"/>
            <Setter Property="Padding" Value="10,0,3,0"/>
            <Setter Property="Background" Value="{StaticResource GridView_GroupPanelBackground}"/>
            <Setter Property="BorderBrush" Value="{StaticResource GridView_GroupPanelOuterBorder}"/>
            <Setter Property="BorderThickness" Value="0,0,0,1"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="HorizontalContentAlignment" Value="Left"/>
        </Style>               
    </navigation:Page.Resources>

I would like to do something like: this.panelText = "bla bla" is this possible?

Someone has any idea?

When I type in this.paneltext in my cs file then it doesn't recognize it?

3 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 09 Aug 2010, 03:27 PM
Hello Gilbert van Veen,

I am sending you an example how to do this and you can see in the attached picture how to modifiy panel text using Expression Blend.
Please let me know if you need any additional information.
Sincerely yours,
Vanya Pavlova
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Gilbert van Veen
Top achievements
Rank 1
answered on 09 Aug 2010, 03:31 PM
Thanks Vanya,

But it is not clear to me how to change the paneltext by code behind?

Gilbert
0
Vanya Pavlova
Telerik team
answered on 10 Aug 2010, 08:01 AM
Hello Gilbert van Veen,

In order to change the GroupPanel text in code I would suggest you to take a look at this forum thread.

Best wishes,
Vanya Pavlova
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Gilbert van Veen
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Gilbert van Veen
Top achievements
Rank 1
Share this question
or