All pastes #605587 Raw Edit

Stuff

public text v1 · immutable
·published 2007-07-06 09:49 UTC
rendered paste body
	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;
		}
	}