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

'GridView:AlignmentContentPresenter' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.

2 Answers 85 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Leon
Top achievements
Rank 1
Leon asked on 19 Sep 2011, 06:19 PM
Hey There,

I recently updated from SL3 to SL4 binaries and once I built I am getting this error in my XAML.

This used to work before but with the new binaries - version 2011.2.712.1040 I am getting this error. All binaries are updated in the project and nothing else has changed.
Below is a copy of my code...Please advise.  

<Controls:RadGridView x:Class="TableViewxxxxxxx"
    xmlns:Controls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"
    xmlns:GridView="clr-namespace:Telerik.Windows.Controls.GridView;assembly=Telerik.Windows.Controls.GridView"
    AutoGenerateColumns="False" CanUserReorderColumns="True" CanUserSortColumns="True" CanUserFreezeColumns="False"
    IsReadOnly="True" IsFilteringAllowed="False" SelectionMode="Extended" RowIndicatorVisibility="Collapsed"
    RowDetailsVisibilityMode="Collapsed" GridLinesVisibility="None" ShowGroupPanel="False" AlternationCount="2" Background="White">
    <Controls:RadGridView.Resources>
        <SolidColorBrush x:Key="GridViewDisabledBackground" Color="#FFEEEEEE"/>
        <SolidColorBrush x:Key="GridViewDisabledBorderBrush" Color="#FFBBBBBB"/>
        <SolidColorBrush x:Key="GridLinesFill" Color="#FFB3B3B3"/>
        <ControlTemplate x:Key="GridViewCellTemplate" TargetType="GridView:GridViewCell">
            <Border x:Name="PART_CellBorder" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                <VisualStateManager.VisualStateGroups>
                    <VisualStateGroup x:Name="CommonStates">
                        <VisualState x:Name="Normal"/>
                        <VisualState x:Name="Current">
                            <Storyboard>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_CellBorder" Storyboard.TargetProperty="Background">
                                    <DiscreteObjectKeyFrame KeyTime="0:0:0">
                                        <DiscreteObjectKeyFrame.Value>
                                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                <GradientStop Color="#00FFFDF9" Offset="0"/>
                                                <GradientStop Color="#00FFEDC7" Offset="1"/>
                                            </LinearGradientBrush>
                                        </DiscreteObjectKeyFrame.Value>
                                    </DiscreteObjectKeyFrame>
                                </ObjectAnimationUsingKeyFrames>
                            </Storyboard>
                        </VisualState>
                    </VisualStateGroup>
                    <VisualStateGroup x:Name="EditingStates">
                        <VisualState x:Name="Edited">
                            <Storyboard>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_ContentPresenter" Storyboard.TargetProperty="Margin">
                                    <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="0"/>
                                </ObjectAnimationUsingKeyFrames>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_ContentPresenter" Storyboard.TargetProperty="VerticalAlignment">
                                    <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Stretch"/>
                                </ObjectAnimationUsingKeyFrames>
                            </Storyboard>
                        </VisualState>
                        <VisualState x:Name="Display"/>
                    </VisualStateGroup>
                    <VisualStateGroup x:Name="DisabledStates">
                        <VisualState x:Name="Enabled"/>
                        <VisualState x:Name="Disabled">
                            <Storyboard>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_CellBorder" Storyboard.TargetProperty="Background">
                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource GridViewDisabledBackground}"/>
                                </ObjectAnimationUsingKeyFrames>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_CellBorder" Storyboard.TargetProperty="BorderBrush">
                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource GridViewDisabledBorderBrush}"/>
                                </ObjectAnimationUsingKeyFrames>
                            </Storyboard>
                        </VisualState>
                    </VisualStateGroup>
                </VisualStateManager.VisualStateGroups>
                <Grid>
                <GridView:AlignmentContentPresenter x:Name="PART_ContentPresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Visibility="Visible" Foreground="{TemplateBinding Foreground}" TextAlignment="{TemplateBinding TextAlignment}" TextDecorations="{TemplateBinding TextDecorations}" TextWrapping="{TemplateBinding TextWrapping}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                </Grid>
            </Border>
        </ControlTemplate>
        <Style x:Key="TableViewCellStyle" TargetType="GridView:GridViewCell">
            <Setter Property="Template" Value="{StaticResource GridViewCellTemplate}"/>
            <Setter Property="Padding" Value="5,0,3,0"/>
            <Setter Property="BorderBrush" Value="{StaticResource GridLinesFill}"/>
            <Setter Property="BorderThickness" Value="0,0,1,0"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
            <Setter Property="Background" Value="Transparent"/>
        </Style>
        <Style x:Key="TableViewAlternateRowStyle" TargetType="GridView:GridViewRow">
            <Setter Property="Background" Value="#FFF0F0F0" />
        </Style>
        <Style x:Key="TableViewHeaderCellStyle" TargetType="GridView:GridViewHeaderCell">
            <Setter Property="FontWeight" Value="Normal" />
            <Setter Property="Height" Value="35"/>
            <Setter Property="Background">
                <Setter.Value>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FF198FB0" Offset="0"/>
                        <GradientStop Color="#FF0E7093" Offset="1"/>
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>
            <!--<Setter Property="Margin" Value="0,0,1,0"/>-->
 
        </Style>
        <!--<Style x:Key="TableViewRowStyle" TargetType="GridView:GridViewRow">
            <Setter Property="Background" Value="#FF3399FF" />
        </Style>-->
    </Controls:RadGridView.Resources>
</Controls:RadGridView>

the line giving me problems is : <GridView:AlignmentContentPresenter x:Name="PART_ContentPresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Visibility="Visible" Foreground="{TemplateBinding Foreground}" TextAlignment="{TemplateBinding TextAlignment}" TextDecorations="{TemplateBinding TextDecorations}" TextWrapping="{TemplateBinding TextWrapping}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>

Many Thanks
Leon   

2 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 20 Sep 2011, 06:29 AM
Hello,

 This class was removed back in 2009 (beta for Q1 2010). It will be better to extract the latest grid templates with Blend.

Kind regards,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Leon
Top achievements
Rank 1
answered on 20 Sep 2011, 06:40 AM
Is there a resource you can point me to that will explain how to do this?

I am quite new at this.

Many thanks

Leon
Tags
GridView
Asked by
Leon
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Leon
Top achievements
Rank 1
Share this question
or