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

GridViewImageColumn - code behind

2 Answers 129 Views
GridView
This is a migrated thread and some comments may be shown as answers.
ITA
Top achievements
Rank 1
ITA asked on 25 Oct 2012, 09:34 AM
Hi,

i use a RadGridView with a "GridViewImageColumn" like this:
<telerik:GridViewImageColumn DataMemberBinding="{Binding Bild}" Width="50" IsEnabled="False" ImageStretch="None" />

But how do i bind an image to this column:
public class Calls
{
public string Name { get; set; }
public string Tele { get; set; }
public string time { get; set; }
public string Datum { get; set; }
public Image bild { get; set; }
}
ObservableCollection<Calls> _CallCollection = new ObservableCollection<Calls>();
_CallCollection.Add(new Calls
{
Name = name_s,
Tele = tele_s,
time = time_s,
Datum = datum_s,
bild = image
});

Name, Tele, time and Datum is ok, but i can't see an image. How do i solve this?

i tried:
var image = new Image();
image.Source = new BitmapImage(new Uri("pack://application:,,/Images/settings.png", UriKind.Absolute));

But this is wrong...

thanks a lot
Rene

2 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 25 Oct 2012, 10:34 AM
Hello Rene,

You may bind the GridViewImageColumn to a string or a byte[] data using the DataMemberBinding property. Please check this forum thread for further information.

Kind regards,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
ITA
Top achievements
Rank 1
answered on 25 Oct 2012, 10:42 AM
Hi,

i solved se Problem by using a string and a Converter.

thanks
Tags
GridView
Asked by
ITA
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
ITA
Top achievements
Rank 1
Share this question
or