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

How to display default image in GridBinaryImageColumn?

1 Answer 68 Views
Grid
This is a migrated thread and some comments may be shown as answers.
tomekm
Top achievements
Rank 1
tomekm asked on 11 Aug 2010, 10:21 AM

I use GridBinaryImageColumn in RadGrid. Some rows don't have images so that cell should be empty or have default image. How to do this?

I tried but it does not work.

1.protected void RadGrid_databound(object sender, GridItemEventArgs e)
2.       {
3.           if (e.Item is GridDataItem)
4.           {
5.               GridDataItem item = e.Item as GridDataItem;
6.               (item["LogoColumn"].Controls[0] as Image).ImageUrl = "~/App_Themes/Theme1/Images/default.gif";
7.           }
8.       }

Setting item.Visible = false show empty image icon in IE

1 Answer, 1 is accepted

Sort by
0
Accepted
Rosen
Telerik team
answered on 16 Aug 2010, 08:02 AM
Hi Rychu,

In order to assign a default image to GridBinaryImageColumn, you should use column's DefaultImageUrl property.

Best wishes,
Rosen
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
tomekm
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Share this question
or