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

RadGrid Images

2 Answers 62 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jonny Sheldrake
Top achievements
Rank 1
Jonny Sheldrake asked on 08 Aug 2008, 02:26 PM
Hi All,

I have built my RadGrid and it's working like a dream but i have a quick question.

Depending on one of the fields information in this case ".xls" i want to show an excel icon at the side of that. The icons sit in a folder in my web project so i can use them all over the app. Is there a way i can do this programmatically when i bring my dataset back?

Cheers

Jonny

2 Answers, 1 is accepted

Sort by
0
Cres
Top achievements
Rank 1
answered on 10 Aug 2008, 03:39 PM
hi jonny,

i suggest you convert your column into a template, then put an asp:image on the side with imageurl as indicated below. 
protected string GetIcon()  
{  
   if (Eval("field")!=null && Eval("field").ToString().IndexOf("substring")>-1)  
      return "~/images/icons/xls.gif";  
   return "~/images/icons/blank.gif";  

hth,
-cris
0
Jonny Sheldrake
Top achievements
Rank 1
answered on 11 Aug 2008, 04:45 PM
Hi Cris,

Thanks for your help on this. On what event should i fire this bit of code?

Cheers

Jonny
Tags
Grid
Asked by
Jonny Sheldrake
Top achievements
Rank 1
Answers by
Cres
Top achievements
Rank 1
Jonny Sheldrake
Top achievements
Rank 1
Share this question
or