Hi All
I am displaying a tool tip for a column in a datagrid. But if there is not data in the column, the tooltip still shows up without any content. How to control the visibility of tooltip when there is not data?
Thanks in advance
Tooltip visibility
5 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Amruta Kirdat72 reputationPosted Mar 15, 2011, 2:37 AM EDT
u can code like this: // this is for all columns i.e all data from that datagrid
if(datagrid.rows.count>0)
{
tooltip.visible = true;
}
else
{
tooltip.visible=false;
}
Nivedita72 reputationPosted Mar 15, 2011, 3:33 AM EDT
But for a single template column if i have to give a tool tip. And in case the data is not there then tooltip wont get displayed.
Thanks in advance
Amruta Kirdat72 reputationPosted Mar 15, 2011, 8:31 PM EDT
plz try this...
for (int i = 0; i < dataGridView1.Rows.Count; i++)
{
if (dataGridView1.Rows[i].Cells[2].Value == "")
{
tooltip.visible = false;
}
else
{
tooltip.visible = true;
}
}
Amruta Kirdat72 reputationPosted Mar 15, 2011, 8:32 PM EDT
Suthish NairRank #92 · 22.8K reputationPosted Mar 16, 2011, 11:43 AM EDT