You can always have a StatusStrip and with the help of the CellMouseEnter and CellMouseLeave events, an CellMouseLeave set and removed (respectively) from the status bar.
private void dgvCellMouseEnter(object sender, DataGridViewCellEventArgs e) { statusStrip1.Text = (sender as DataGridView)[e.ColumnIndex, e.RowIndex].ToolTipText; } private void dgvCellMouseLeave(object sender, DataGridViewCellEventArgs e) { statusStrip1.Text = ""; }
As an optional feature, you can show that the cell has โextraโ information by showing a small mark, such as Excel. Here is a small piece of code that I use to do the same:
private void dgvCellPainting(object sender, DataGridViewCellPaintingEventArgs e) { if (e.ColumnIndex != -1) && (e.RowIndex != -1) { DataGridViewCell dgvCell = (sender as DataGridView)[e.ColumnIndex, e.RowIndex]; Pen greenPen = new Pen(Color.Green, 2); Boolean hasTooltip = !dgvCell.ToolTipText.Equals(""); Boolean hasCompleted = (dgvCell.Tag as CellInfo).complete;
This code draws a blue border around the cell if hasTooltip is true, a green border if hasCompleted is true, and both borders (with green inside) if both are true.
Jesse
source share