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

GridImageColumn display image

1 Answer 1030 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Geoff
Top achievements
Rank 1
Geoff asked on 06 Jun 2013, 06:15 PM
I'm populating a Radgrid in code behind and I am having some difficulty understanding how to get my image to appear.

The data column I'm trying to read from is called 'ImageUrl" however my src is an empty string when I build and run the project.

Here is the code for the GridImageColumn.

GridImageColumn gi1 = new GridImageColumn();
gi1.DataAlternateTextField = "ImageUrl";
gi1.DataImageUrlFields = new string [] {"ImageUrl"};
//gi1.DataImageUrlFormatString = "/{0}";
gi1.HeaderText = "Image";
gi1.HeaderStyle.HorizontalAlign = HorizontalAlign.Center;
gi1.Visible = true;
gi1.ImageAlign = ImageAlign.Middle;
gi1.ImageHeight = Unit.Pixel(25);
gi1.ImageWidth = Unit.Pixel(25);
rg1.MasterTableView.Columns.Add(gi1);

Is there a property that I'm not setting or setting incorrectly? I was assuming that the DataImageUrlFields would read the data just like a GridBoundColumn would read it's DataField.

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 10 Jun 2013, 09:43 AM
Hi

Please try the following demo,it describes about all the column types and its property.
Image Column

Thanks
Princy
Tags
Grid
Asked by
Geoff
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or