GridViewDataColumn.CellTemplate error after upgrading to Silverlight 3

5 posts, 0 answers
  1. Laurel Carpenter
    Laurel Carpenter avatar
    4 posts
    Member since:
    Jul 2009

    Posted 15 Jul 2009 Link to this post

    I am trying to upgrade my Silverlight 2/Telerik Project to Silverlight 3 using your recent build.  VS 2008 is giving my a compiler error on:

    telerik

     

    :GridViewDataColumn.CellTemplate

     


    Here is the namespace I am using:

    xmlns

     

    :telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"

     


    Error message:  The property 'CellTemplate' does not exist on the type 'GridViewDataColumn' in the XML namespace 'clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Controls.GridView'.

    Here is my Xaml:

    <

     

    telerik:RadGridView Name="radgridShoppingCart" Grid.Row="1" Width="825" AutoGenerateColumns="False" HorizontalAlignment="Left" >

     

     

     

    <telerik:RadGridView.Columns>

     

     

     

    <telerik:GridViewDataColumn HeaderText="Item Barcode" Width="115" DataMemberBinding = "{Binding ItemBarcode}" ></telerik:GridViewDataColumn>

     

     

     

    <telerik:GridViewDataColumn HeaderText="Container Barcode" Width="140" DataMemberBinding = "{Binding ContainerBarcode}"></telerik:GridViewDataColumn>

     

     

     

    <telerik:GridViewDataColumn HeaderText="Status" Width="70" DataMemberBinding = "{Binding Status}"></telerik:GridViewDataColumn>

     

     

     

    <telerik:GridViewDataColumn HeaderText="Site" Width="175" DataMemberBinding = "{Binding SiteDescription}"></telerik:GridViewDataColumn>

     

     

     

    <telerik:GridViewDataColumn HeaderText="Vault" Width="85" DataMemberBinding = "{Binding VaultName}"></telerik:GridViewDataColumn>

     

     

     

    <telerik:GridViewDataColumn HeaderText="Rack" Width="75" DataMemberBinding = "{Binding Rack}"></telerik:GridViewDataColumn>

     

     

     

    <telerik:GridViewDataColumn HeaderText="Slot" Width="75" DataMemberBinding = "{Binding Slot}"></telerik:GridViewDataColumn>

     

     

     

    <telerik:GridViewDataColumn Width="60" >

     

     

     

    <telerik:GridViewDataColumn.CellTemplate>

     

     

     

    <DataTemplate>

     

     

     

    <Button Content="Delete" Click="Button_Click_7" Width="50" />

     

     

     

    </DataTemplate>

     

     

     

    </telerik:GridViewDataColumn.CellTemplate>

     

     

     

    </telerik:GridViewDataColumn>

     

     

     

    </telerik:RadGridView.Columns>

     

     

     

    </telerik:RadGridView>

    thanks

    mark

     

  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 16 Jul 2009 Link to this post

    Hello Mark,

    I've just tried this however everything worked fine on my end using your grid declaration. You can find an example project attached.

    Kind regards,
    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.
  3. mark
    mark avatar
    50 posts
    Member since:
    Mar 2009

    Posted 16 Jul 2009 Link to this post

    I downloaded the solution and I can't get the Silverlight Project to open.  I get an error message stating:  Unable to read Project(the Silverlight project, not the web project)...The imported project "C:\path...\v3.0\Microsoft.Silverlight.CSharp.targets" was not found.  Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

    Regardless of the sample project, I found out yesterday that I was pointing to the Telerik 2.0Silverlight Gridview dll.  I changed the reference to the Telerik 3.0 control and now I get the following error message in the xaml:  Invalid attribute value telerik:GridViewCell for property TargetType.  [Line no.].

    Namespace:  
    xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"

    Xaml:
    <telerik:RadGridView HorizontalAlignment="Left" Foreground="Brown" ShowGroupPanel="False" CanUserReorderColumns="True" Name="radGridElementItems" Grid.Row="1" Grid.Column="0" AutoGenerateColumns="False" Width="825">
                        <telerik:RadGridView.Columns>
                            <telerik:GridViewColumn HeaderText="" Width="35" >
                                <telerik:GridViewColumn.CellStyle>
                                    <Style TargetType="telerik:GridViewCell">
                                        <Setter Property="Template">
                                            <Setter.Value>
                                                <ControlTemplate TargetType="telerik:GridViewCell">
                                                    <Border Padding="5,0,5,0" BorderThickness="0,0,1,1" BorderBrush="#FFB3B3B3">
                                                        <CheckBox HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                                    </Border>
                                                </ControlTemplate>
                                            </Setter.Value>
                                        </Setter>
                                    </Style>
                                </telerik:GridViewColumn.CellStyle>
                            </telerik:GridViewColumn>
                            <telerik:GridViewDataColumn HeaderText="Item Barcode" Width="115" DataMemberBinding = "{Binding ItemBarcode}" ></telerik:GridViewDataColumn>
                        </telerik:RadGridView.Columns>
                    </telerik:RadGridView>




    EDIT:  More Information...
    I tried changing the namespace to:
    xmlns:telerikGrid="clr-namespace:Telerik.Windows.Controls.GridView;assembly=Telerik.Windows.Controls.GridView"

    but that still didn't work.  Then I received a xaml error stating that this namespace was invalid. 

    here is how I changed the xaml:
    <telerik:RadGridView.Columns>
                            <telerik:GridViewColumn HeaderText="" Width="35" >
                                <telerik:GridViewColumn.CellStyle>
                                    <Style TargetType="telerikGrid:GridViewCell">
                                        <Setter Property="Template">
                                            <Setter.Value>
                                                <ControlTemplate TargetType="telerikGrid:GridViewCell">
                                                    <Border Padding="5,0,5,0" BorderThickness="0,0,1,1" BorderBrush="#FFB3B3B3">
                                                        <CheckBox HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                                    </Border>
                                                </ControlTemplate>
                                            </Setter.Value>
                                        </Setter>
                                    </Style>
                                </telerik:GridViewColumn.CellStyle>
                            </telerik:GridViewColumn>

    Thanks again.

    mark



  4. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 17 Jul 2009 Link to this post

    Hi mark,

    Do you have Silverlight 3 RTW installed with all needed Visual Studio tools?

    Greetings,
    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.
  5. mark
    mark avatar
    50 posts
    Member since:
    Mar 2009

    Posted 17 Jul 2009 Link to this post

    Seems to be working now.  I just created a new SL 3 app, added the grid/code...and it seems to be working.  Then I copied that code back to the original project(including namespaces) and it is working now.  Not sure what went wrong, but it is working now.

    thanks

    mark
Back to Top