Hi Guys,
I have loaded messages in dataGridview!! each message have descriptions
i have to show them as tool tip or someother way when the mouse overs it based on the Row's message
Any Idea
advanced thanks Cheers
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.
narasimman gPosted May 17, 2011, 8:10 AM
narasimman gPosted May 17, 2011, 8:08 AM
private void dataGridView1_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)
{
foreach (DataGridViewRow row in ((DataGridView)sender).Rows)
{
foreach (DataGridViewCell cell in row.Cells)
{
// Where 'myModelClass' is the name of your current data source model class in question for this row.
if (String.Compare(dataGridView1.Columns[cell.ColumnIndex].Name, "Message", true) == 0)
{
DisplayCellTooltip(cell);
}
}
}
}
private void DisplayCellTooltip(DataGridViewCell cell)
{
cell.ToolTipText = hashDescription[cell.Value.ToString()].ToString(); //I used hash table here..stored values in form load...
}
ShankeyPosted Jan 6, 2011, 1:29 AM
please have a look at following links,
http://stackoverflow.com/questions/493756/showing-a-tooltip-inside-a-datagrid
http://stackoverflow.com/questions/219581/how-can-tooltips-be-added-to-a-vb-net-winforms-datagrid-rows
hope it will help you