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:
and this is the list :
Here is my images declaration in resources:
and this is how i add items in the list :
Finally, i put :
and i bind columns in XAML like this :
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
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
xmlns:x
=
"http://schemas.microsoft.com/winfx/2006/xaml"
>
<
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