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

Setting radgridview column DataType in xaml

3 Answers 614 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jim
Top achievements
Rank 1
Jim asked on 27 May 2011, 02:17 PM
I am using a radgridview but most of the columns have no filters
Seaching the net I see references to setting the DataType in the column definitions

In my xaml I have set the name space as

xmlns

 

 

:system="clr-namespace:System;assembly=mscorlib"

 


And define my colums thus.

 

 

 

<telerik:RadGridView.Columns>

 

 

 

 

<telerik:GridViewDataColumn DataType="system:String" DataMemberBinding="{Binding FirstName}" Header="First Name" UniqueName="FirstName" />

 

 

 

 

</telerik:RadGridView.Columns>

 


Once I run it I get
Failed to create a 'System.Type' from the text 'system:String'. [Line: 64 Position: 62]

Any ideas or am I down the wrong path ??
Thanks
Jim

3 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 27 May 2011, 03:17 PM
Hi Jim,

 

You cannot specify types in XAML under Silverlight, you should do it manually in code-behind through accessing particular column, as shown below:


var column = this.radGridView1.Columns["SomeColumn"] as GridViewBoundColumnBase;
if (column != null)
{
  column.DataType = typeof(string);
}


Kind regards,
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
Marc Roussel
Top achievements
Rank 2
answered on 29 Apr 2013, 01:31 PM
Is this still true today with the latest version as of today ?
I ask because the Property is there in xaml
0
Vanya Pavlova
Telerik team
answered on 29 Apr 2013, 05:36 PM
Hi Marc,

 
Actually in the world of Silverlight 5 you can specify a DataType in XAML and the previous problem does not persist.
Hope this helps! 



All the best,
Vanya Pavlova
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GridView
Asked by
Jim
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Marc Roussel
Top achievements
Rank 2
Share this question
or