public void grid1_ItemContentCreated(object sender, GridItemContentCreatedEventArgs e) { DataRow r = e.Item.DataItem as DataRow; Image imgDocumentType = (Image)e.Content.FindControl("imgDocumentType"); if (imgDocumentType != null) { string extension = r[12].ToString(); string ctype = r[11].ToString(); string description = MimeTypesUtility.GetDescription(extension); string icon = MimeTypesUtility.GetIcon(ctype); imgDocumentType.ImageUrl = String.Format("~/images/document/{0}.gif", icon); imgDocumentType.ToolTip = description; } }