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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
ShankeyRank #972 · 2.1K reputationPosted Jan 5, 2011, 8:29 PM EST
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
narasimman g146 reputationPosted May 17, 2011, 4:08 AM EDT
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...
}
narasimman g146 reputationPosted May 17, 2011, 4:10 AM EDT