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
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Suthish NairPosted Mar 16, 2011, 3:43 PM
Amruta KirdatPosted Mar 16, 2011, 12:32 AM
Amruta KirdatPosted Mar 16, 2011, 12:31 AM
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;
}
}
NiveditaPosted Mar 15, 2011, 7:33 AM
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 KirdatPosted Mar 15, 2011, 6:37 AM
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;
}