You need to use a template column, not a bound column, which you can create in the property builder in the idea, or straight in the html. Bound column is good for showing something that resolves to text (and the format string can format it for you), but you need a picture in this case. Try something like this, where GetMyPicture is your function that returns the filename of the image you want to show. In my case, I'm passing container.dataitem("cs_key"), which will resolve to the cs_key field in the datasource. In your case, for cs_key you'll use the column name of your type field
<asp:TemplateColumn HeaderText="My Picture Column"><itemtemplate><img src='<%# GetMyPicture(container.dataitem("cs_key")) %>'/> (don't forget the '#'
</itemtemplate></asp:TemplateColumn
Regarding the protected function, that should be fine, but if at run-time it can't find it you'll get a semi-friendly message, something to the effect of "...GetMyPicture is not declared...
hth
Bil
----- C Newby wrote: ----
Actually, that's not working for me. When the page renders, the table cel
just contains the expression. For example, i have something like
<asp:BoundColumn DataField="Something" HeaderText="Something
DataFormatString="<%=getSomething({0})%>"></asp:BoundColumn
which renders
<td><%=getSomething( SomeType )%></td
But I do have a protected member method of the code behind class calle
getSomething( someType Type ){ return "something";
Any thoughts
thanks/
Bill Borg said:
You can also write a function in your databinding expression for the imag
cell, e.g. imageurl (or src)=<%# GetMyImage(parms) %>, where GetMyImage i
an accessible method (e.g. page.getmyimage), and parms is whatever you wan
to pass to get the image (the value of Type in this case)