Is is possible to have a image instead of text in the DataGridViewLinkColumn. In the below example, instead of "search" text, can we have a search icon in the cell!?
private void Form1_Load(object sender, EventArgs e)
{
DataGridViewLinkColumn c = new DataGridViewLinkColumn();
dataGridView1.Columns.Add(c);
dataGridView1.Rows.Add();
dataGridView1.Rows[0].Cells[0].Value = "search";
}
When I try assigning a image to the value of the cell, it is not getting displayed rather displayed as "System.Drawing.Bitmap"
Use a standard
DataGridViewImageColumn
to display the images, then create aDataGridView_CellMouseMove
event for theDataGridView
with the following codeAdd logic to detect rows if required.
The
DataGridView_CellMouseClick
events will still be needed for your links.And you may also need a
DataGridView_MouseLeave
event to ensure that you set theCursor
back to the default.