private void Page1_Load(object sender, EventArgs e)
{
this.dataGridView1.RowCount = 10;
this.dataGridView1.Rows[0][0].Style.BackgroundImageSource = “Images/Wisej-256×256.png”;
this.dataGridView1.Rows[0][1].Style.BackgroundImage = new Bitmap(Application.MapPath(“Images\\Wisej-256×256.png”));
}
See attached. In general I wouldn’t use new Bitmap(), use the ImageSource property instead and deploy the /Images. This way there is no memory usage on the server to load the image and it’s also cached on the browser.
Please login first to submit.