Click here to Skip to main content
15,895,815 members
Articles / Programming Languages / C#
Alternative
Tip/Trick

Show cell value as tool tip for a Windows Form Grid

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
31 Aug 2011CPOL 5.8K   1  
Very nice..I was looking for such a code. I added one more line to avoid error on hovering mouse elsewhere in the DataGridView.private void gridView1_CellToolTipTextNeeded(object sender, DataGridViewCellToolTipTextNeededEventArgs e){if (e.ColumnIndex == -1 || e.RowIndex == -1)...

Very nice..I was looking for such a code. I added one more line to avoid error on hovering mouse elsewhere in the DataGridView.


C#
private void gridView1_CellToolTipTextNeeded(object sender,
    DataGridViewCellToolTipTextNeededEventArgs e)
{
if (e.ColumnIndex == -1 || e.RowIndex == -1) return;
    if (e.ColumnIndex == 0)
        e.ToolTipText = "PrintPreview";
    ...
}

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
-- There are no messages in this forum --