Image imgCalibration = (Image)e.RowIndex.FindControl("imgCalibration"); DataGridViewImageColumn img = new DataGridViewImageColumn(); if (!string.IsNullOrEmpty(Calibaration)) { string[] Cal = Calibaration.Split('.'); if (Cal[1].ToString() == "pdf" || Cal[1].ToString() == "PDF") // Bitmap img = new Bitmap("~/Images/pdf.png"); // System.Drawing.Image imgCalibration = Image.FromFile("~/Images/pdf.png"); //img.Image = imgCalibration; gvProduct.Rows[e.RowIndex].Cells["CalibratCertificate"].Value = Image.FromFile("~/images/pdf.png"); //imgCalibration.ImageUrl = "~/Images/pdf.png"; else if (Cal[1].ToString() == "docx" || Cal[1].ToString() == "DOCX" || Cal[1].ToString() == "doc" || Cal[1].ToString() == "DOC") gvProduct.Rows[e.RowIndex].Cells["CalibratCertificate"].Value = Image.FromFile("~/images/word.png"); //imgCalibration.ImageUrl = "~/Images/word.png"; else if (Cal[1].ToString() == "xls" || Cal[1].ToString() == "XLS") gvProduct.Rows[e.RowIndex].Cells["CalibratCertificate"].Value = Image.FromFile("~/images/Excel.png"); // imgCalibration.ImageUrl = "~/Images/Excel.png"; //hlCertificate.Visible = true; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)