GridViewImageColumn cannot be displayed

3 posts, 1 answers
  1. Haythem
    Haythem avatar
    26 posts
    Member since:
    Jun 2013

    Posted 09 Jan 2014 Link to this post

    Hello,
    I want to use a GridViewImageColumn in my grid but i have some issues with it , i explain:
    I have a list of items that i am affecting to gridView item source , that item contains an image member here an example:

    public class Item
        {
            public string FirstName { get; set; }
            public string LasttName { get; set; }
            public ImageBrush Country { get; set; }
        }

    and this is the list :
    ObservableCollection<Item> _items= new ObservableCollection<Item>();

    Here is my images declaration in resources:
    <ResourceDictionary
        <ImageBrush x:Key="FranceFlag" ImageSource="/XspreadsLight;component/Assets/Images/Countries/fr.png"/>
        <ImageBrush x:Key="ItalyFlag" ImageSource="/XspreadsLight;component/Assets/Images/Countries/it.png"/>
        <ImageBrush x:Key="GermanyFlag" ImageSource="/XspreadsLight;component/Assets/Images/Countries/de.png"/>
        <ImageBrush x:Key="EurFlag" ImageSource="/XspreadsLight;component/Assets/Images/Countries/euro.png"/>
    </ResourceDictionary>

    and this is how i add items in the list :
    var imgFr = (ImageBrush)Resources["FranceFlag"];
     _items.Add( new Item("Jack","Dupont",imgFr));


    Finally, i put :
    MyRadGridView.itemsSource=_items;


    and i bind columns in XAML like this :
    <telerik:GridViewImageColumn  Header="COUNTRY"  DataMemberBinding="{Binding Country}"  />
    <telerik:GridViewDataColumn  Header="FNAME" DataMemberBinding="{Binding FirstName}"  />
    <telerik:GridViewDataColumn  Header="LNAME" DataMemberBinding="{Binding LastName}"  />

    first name and last names are ok but i have no country image displayed... how can i do this please?
    Waiting forward for your response

    Cordially
    KAROUI Haythem

  2. Answer
    Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 10 Jan 2014 Link to this post

    Hi,

    Please check our online documentation on configuring GridViewImageColumn.

    Regards,
    Didie
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. DevCraft banner
  4. Haythem
    Haythem avatar
    26 posts
    Member since:
    Jun 2013

    Posted 10 Jan 2014 Link to this post

    Thank you for your efficient answer ,

    Cordially,
    KAROUI Haythem
Back to Top