views:

29

answers:

1

Is there any way to bind a tooltip to a datasource. Here is a simplified example of what I am trying to do.

I have a DataTable with two columns, one is a datetime the other is a varchar. This DataTable is bound to a BindingSource. That binding source has its current record bound to a label displaying the datetime column. How can I get the varchar field associated with that row to show up in the tooltip when I hover over the label showing the date.

I understand how tooltips work when doing static text I am just having trouble figuring out how to do it with a dynamic source.

Also please have your examples in WinForms, almost all of the examples I googled are all WPF based.

A: 

I don't really like this answer so I hope someone can come up with a better one (in my real code I have about 30 fields that will have the popup) but I could do this

dsMyRows_OnCurrentItemChanged(sender, EventArgs e)
{
    ttPersonWhoDidAction.SetToolTip(lblDate, ((DataRowView)dsMyRows.Current)["TextValue"]);
}
Scott Chamberlain