Setting radgridview column DataType in xaml

4 posts, 0 answers
  1. Jim
    Jim avatar
    68 posts
    Member since:
    Apr 2011

    Posted 27 May 2011 Link to this post

    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
  2. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 27 May 2011 Link to this post

    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
  3. DevCraft banner
  4. Marc Roussel
    Marc Roussel avatar
    429 posts
    Member since:
    Dec 2009

    Posted 29 Apr 2013 Link to this post

    Is this still true today with the latest version as of today ?
    I ask because the Property is there in xaml
  5. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 29 Apr 2013 Link to this post

    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.

Back to Top