I find it easier to do one of the following options:
OPTION 1: bind in markup:
1. Prepare your datasource to include the url on query (maybe put some "case when " style logic in your DB query). e.g. SELECT url AS imageUrl FROM myTable...
2. Bind image source url to control on markup
e.g.
<img src="<%#Eval("imageUrl")" />
OPTION 2: Add image control on row data bind
string imageUrlValue = @"...\images\{0}.ico";
DataRow myRow = e.Row.DataItem as DataRow;
Image img = new Image();
img.ImageUrl =
string.Format
(
imageUrlValue,
myRow["Mycolumn"] == "1" ? "greendot" : "reddot"
);
row.Cells[2].Controls.Add(img);