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

[Solved] Adding Checkbox column to silverlight radgridview

4 Answers 297 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.
Abhishek Chauhan
Top achievements
Rank 1
Abhishek Chauhan asked on 24 Sep 2009, 01:33 PM
I am using Silverlight 3.0 and I'm trying to add a column with checkboxes (to facilitate the selection of rows) to the radgrid using the following piece of code-

 

 

<telerikGridView:GridViewColumn HeaderText="Check">

 

 

 

<telerikGridView:GridViewColumn.CellStyle>

 

 

 

<Style TargetType="telerikGridView:GridViewCell">

 

 

 

<Setter Property="Template">

 

 

 

<Setter.Value>

 

 

 

<ControlTemplate TargetType="telerikGridView: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>

 

 

 

</telerikGridView:GridViewColumn.CellStyle>

 

 

 

</telerikGridView:GridViewColumn>

 


But its throwing an error-"Invalid attribute telerikGridView:GridViewCell for property TargetType".

I am not sure If I am missing any namespace or its because of any other reason.
Please help me to resolve this.

Thanks in Advance,
Abhishek Chauhan


4 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 24 Sep 2009, 01:53 PM
Hello Abhishek,

You need to register Telerik.Windows.Controls.GridView namespace. Here is an example:
    xmlns:telerikGridView="clr-namespace:Telerik.Windows.Controls.GridView;assembly=Telerik.Windows.Controls.GridView"

You should however register Telerik.Windows.Controls namespace from Telerik.Windows.Controls.GridView assembly with different prefix.

BTW: We are about to release our next internal build where you can find GridViewSelectColumn.

Greetings,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Abhishek Chauhan
Top achievements
Rank 1
answered on 24 Sep 2009, 02:13 PM
Thanks, but I already have the following entries in my xaml file-

xmlns

 

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

Being new to Silverlight I am not sure if there is anything wrong with the above namespace registrations.....

Thanks & Regards,
Abhishek Chauhan

 

0
Vlad
Telerik team
answered on 24 Sep 2009, 02:18 PM
Hello Abhishek,

You need following declarations:

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

and

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

The column XAML will be:

<telerikGrid:GridViewColumn.CellStyle>
   <Style TargetType="telerikGridView:GridViewCell">
...

Kind regards,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Abhishek Chauhan
Top achievements
Rank 1
answered on 24 Sep 2009, 02:42 PM
Thanks a lot..............its working fine now :)
Tags
GridView
Asked by
Abhishek Chauhan
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Abhishek Chauhan
Top achievements
Rank 1
Share this question
or