I have one gridview in my windows form. Now i’m showing custom tooltip using the following code,
private void Audit_Dg_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
if (e.ColumnIndex == 7 || e.ColumnIndex == 8 || e.ColumnIndex == 10 || e.ColumnIndex == 11 && e.RowIndex >= 0)
{
DataGridViewCell cell = this.Audit_Dg.Rows[e.RowIndex].Cells[e.ColumnIndex];
cell.ToolTipText = "Click Here To View The Message";
}
}
it showing my message for those cells satisfying my condition and the cell content for all those doesn’t satisfying my condition. is there any way to remove that tool-tips from my grid-view and show only my custom tool-tip?
if there any way,please help me…
Unfortunately, the
DataGridViewcontrol does not support this. Its ShowCellToolTips property can only be used to disable tooltips globally. The cases where a tooltip is displayed are documented as:As you can see, there is no way to avoid the third case: If
ShowCellToolTipsistrueand the value of a cell is truncated, a tooltip containing the full value will be displayed.