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

[Solved] Grid view error after updating to Rad Controls for Silverlight Q2 2010

1 Answer 89 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.
Sujay Mahajan
Top achievements
Rank 1
Sujay Mahajan asked on 07 Oct 2010, 04:08 PM

Hi,

I am getting errors after updating rad control to Q 2010 release.
There are two different errors as follows:

Error 1: It displays error message is "The type "Telerik_Windows_Controls_GridView:AlignmentContentPresenter" was not found.". My xaml code is as follows:

 
<Telerik_Windows_Controls_GridView:AlignmentContentPresenter x:Name="PART_ContentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" Visibility="Visible" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
 

Error 2: I am adding a blank row in a gridview, in one of the column I am displaying a "Browse"  with the cell style like button. when user click on this cell it opens the dialog box, but after updating to new release it is stop working. My xaml code for this is as follows:\

<telerik:RadPage.Resources>
  <mylocal:BrowseReplaceConverter x:Key="BrowseReplaceConverter"/>
  <mylocal:DatabindingDebugConverter x:Key="debug"/>
  <Telerik_Windows_Controls_GridView:GridLineWidthToThicknessConverter x:Key="GridLineWidthToThicknessConverter"/>
  <LinearGradientBrush x:Key="GridViewRowSelectedCell" EndPoint="0.5,1" StartPoint="0.5,0">
   <GradientStop Color="#FFFFFDF9" Offset="0"/>
   <GradientStop Color="#FFFFEDC7" Offset="1"/>
  </LinearGradientBrush>
  <SolidColorBrush x:Key="GridViewDisabledBackground" Color="#FFEEEEEE"/>
  <SolidColorBrush x:Key="GridViewDisabledBorderBrush" Color="#FFBBBBBB"/>
  <ControlTemplate x:Key="GridViewCellTemplate" TargetType="Telerik_Windows_Controls_GridView:GridViewCell">
   <Border x:Name="PART_CellBorder" BorderBrush="{TemplateBinding VerticalGridLinesBrush}" BorderThickness="{Binding VerticalGridLinesWidth, ConverterParameter=Right, Converter={StaticResource GridLineWidthToThicknessConverter}, RelativeSource={RelativeSource TemplatedParent}}" Background="{Binding Background, RelativeSource={RelativeSource TemplatedParent}}">
    <VisualStateManager.VisualStateGroups>
     <VisualStateGroup x:Name="CommonStates">
      <VisualState x:Name="Normal"/>
      <VisualState x:Name="Current">
       <Storyboard>
        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="PART_CellBorder">
         <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{StaticResource GridViewRowSelectedCell}"/>
        </ObjectAnimationUsingKeyFrames>
       </Storyboard>
      </VisualState>
     </VisualStateGroup>
     <VisualStateGroup x:Name="EditingStates">
      <VisualState x:Name="Edited">
       <Storyboard>
        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Margin" Storyboard.TargetName="PART_ContentPresenter">
         <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="0"/>
        </ObjectAnimationUsingKeyFrames>
        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="VerticalAlignment" Storyboard.TargetName="PART_ContentPresenter">
         <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.TargetProperty="Background" Storyboard.TargetName="PART_CellBorder">
         <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource GridViewDisabledBackground}"/>
        </ObjectAnimationUsingKeyFrames>
        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="PART_CellBorder">
         <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource GridViewDisabledBorderBrush}"/>
        </ObjectAnimationUsingKeyFrames>
       </Storyboard>
      </VisualState>
     </VisualStateGroup>
    </VisualStateManager.VisualStateGroups>
                <Telerik_Windows_Controls_GridView:AlignmentContentPresenter   x:Name="PART_ContentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}"  Visibility="Visible" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
   </Border>
  </ControlTemplate>
  <SolidColorBrush x:Key="GridLinesFill" Color="#FFB3B3B3"/>
  <Style x:Key="UploadGridViewCellStyle" TargetType="Telerik_Windows_Controls_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="Center"/>
   <Setter Property="Background">
    <Setter.Value>
     <LinearGradientBrush StartPoint="0.499298,1.76598e-006" EndPoint="0.499298,1.00001">
      <GradientStop Color="#FFBCD2E8" Offset="0.424658"/>
      <GradientStop Color="#FFA9C3D6" Offset="0.534723"/>
      <GradientStop Color="#FF96B5C5" Offset="0.625571"/>
      <GradientStop Color="#FF89ABBE" Offset="0.876436"/>
      <GradientStop Color="#FF7DA2B7" Offset="0.96347"/>
     </LinearGradientBrush>
    </Setter.Value>
   </Setter>
  </Style>
 </telerik:RadPage.Resources>  

<StackPanel Orientation="Horizontal" Canvas.Left="68" Canvas.Top="132" Background="#FFFAF9F2" Height="124" Width="636" >
      <StackPanel.Resources>
              
       <DataTemplate x:Key="cmbTemplate">
        <telerikComboBox:RadComboBox x:Name="cmbDocType" SelectionChanged="cmbDocType_SelectionChanged" />
       </DataTemplate>
       <DataTemplate x:Key="UploadTemplate">
        <TextBlock  MouseLeftButtonDown="Browse" Text="{Binding doc_Id, Converter={StaticResource BrowseReplaceConverter}}" ToolTipService.ToolTip="{Binding ConverterParameter=Browse, Converter={StaticResource Localization}, Source={StaticResource Localization}}"/>                   
       </DataTemplate>
       <DataTemplate x:Key="DeleteComplianceTemplate">
        <Canvas  Height="16" Width="16" ToolTipService.ToolTip="{Binding ConverterParameter=Delete, Converter={StaticResource Localization}, Source={StaticResource Localization}}" MouseLeftButtonDown="Delete">
         <Path x:Name="Path_402" Width="14.4838" Height="13.1887" Stretch="Fill" Data="F1 M 863.994,256.903L 872.478,256.903C 874.135,256.903 875.478,258.246 875.478,259.903L 875.478,267.092C 875.478,268.749 874.135,270.092 872.478,270.092L 863.994,270.092C 862.337,270.092 860.994,268.749 860.994,267.092L 860.994,259.903C 860.994,258.246 862.337,256.903 863.994,256.903 Z ">
          <Path.Fill>
           <LinearGradientBrush StartPoint="0.499996,-0.0588197" EndPoint="0.499996,1.05883">
            <GradientStop Color="#FFBC3D3D" Offset="0.424658"/>
            <GradientStop Color="#FFB02D2D" Offset="0.544729"/>
            <GradientStop Color="#FFA41D1D" Offset="0.643836"/>
            <GradientStop Color="#FFAA1212" Offset="0.908261"/>
            <GradientStop Color="#FFB00707" Offset="1"/>
           </LinearGradientBrush>
          </Path.Fill>
         </Path>
         <Canvas x:Name="Group_403" Width="8.75671" Height="8.75677" Canvas.Left="2.4" Canvas.Top="2">
          <Path x:Name="Path_404" Width="8.75671" Height="8.75677" Canvas.Left="0" Canvas.Top="0" Stretch="Fill" Fill="#FFFFFFFF" Data="F1 M 8.75671,1.13513L 5.51349,4.37842L 8.75671,7.62164L 7.62158,8.75677L 4.3783,5.51355L 1.13507,8.75677L 0,7.62164L 3.24323,4.37842L 0,1.13513L 1.13507,0L 4.3783,3.24329L 7.62158,0L 8.75671,1.13513 Z "/>
         </Canvas>
        </Canvas>
       </DataTemplate>      
      </StackPanel.Resources>
            <grid:RadGridView x:Name="radGridCompliance" CanUserSelect="True" CanUserSortColumns="True"
   Visibility="Visible"  Width="636.00" IsSynchronizedWithCurrentItem="True"
   RowIndicatorVisibility="Collapsed"  IsFilteringAllowed="False"  RowLoaded="radGridCompliance_RowLoaded"
   IsReadOnly="False" ScrollMode="RealTime"
   ShowGroupPanel="False" ScrollViewer.VerticalScrollBarVisibility="Visible" SelectionChanged="radGridCompliance_SelectionChanged"
   Background="White"    AutoGenerateColumns="False"  EnableRowVirtualization="True"
    EnableColumnVirtualization="True"
    Margin="0,0,0,-20" CanUserDeleteRows="False" CanUserReorderColumns="False">         
       <grid:RadGridView.Columns>
        <grid:GridViewDataColumn Header="Title/Name" IsReadOnly="True" UniqueName="txtTitle" Width="*" DataMemberBinding="{Binding name, Mode=TwoWay}"/>
        <grid:GridViewDataColumn Width="100" Header="Type"  CellTemplate="{StaticResource cmbTemplate}" />                  
        <grid:GridViewDataColumn Width="100" Header="Upload"   CellStyle="{StaticResource UploadGridViewCellStyle}" CellTemplate="{StaticResource UploadTemplate}" />
        <grid:GridViewDataColumn IsFilterable="False" Width="100"  HeaderTextAlignment="Center" Header="Delete" IsReadOnly="True"  DataMemberBinding="{Binding doc_Id}" CellTemplate="{StaticResource DeleteComplianceTemplate}"/>                 
       </grid:RadGridView.Columns>
      </grid:RadGridView>
<!--<StackPanel.Resources>
    <DataTemplate>
     
    </DataTemplate>
   </StackPanel.Resources>-->
     </StackPanel>

 

  

Thanks in advance for the help,

Sujay

1 Answer, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 08 Oct 2010, 03:40 PM
Hi Sujay,

The AlignmentContentPresenter is obsoleted, because the template of the GridViewRow was changed and it no longer exist. You can find in our online documentation an useful article related to Row Styiling.
Considering your second question it would be greatly appreciated if you send us a small application rather than a piece of code, so that we can debug it locally, any additional information about the grid version will be appreciated as well.

All the best,
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
Sujay Mahajan
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Share this question
or