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

GridViewImageColumn cannot be displayed

2 Answers 16 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Haythem
Top achievements
Rank 1
Haythem asked on 09 Jan 2014, 03:54 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
Dimitrina
Telerik team
answered on 10 Jan 2014, 10:27 AM
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 >>
0
Haythem
Top achievements
Rank 1
answered on 10 Jan 2014, 01:40 PM
Thank you for your efficient answer ,

Cordially,
KAROUI Haythem
Tags
GridView
Asked by
Haythem
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Haythem
Top achievements
Rank 1
Share this question
or