locked
DataRepeater - Add a tooltip to a repeated label RRS feed

  • Question

  • Hi

     

    Do you have an example on how to display a tooltip on a control in a DataRepeater. I am manually binding the controls.

    Thursday, April 3, 2008 11:51 AM

Answers

  • ToolTips should work just as they do with normal WinForms. Just add the ToolTip control to the form and set the ToolTip Text on the control. It should display when the mouse hovers over the control just as it would on a normal form.

     

    Are you not seeing this?

     

    Thursday, April 3, 2008 5:09 PM
  • I found that the tooltip has to be set in the DrawItem event:

     

    Dim lblX As Label = DirectCast(e.DataRepeaterItem.Controls("lblEventDate"), Label)

    ToolTip1.SetToolTip(lblX, lblX.Tag.ToString)

     

    Friday, April 4, 2008 2:38 PM

All replies

  • ToolTips should work just as they do with normal WinForms. Just add the ToolTip control to the form and set the ToolTip Text on the control. It should display when the mouse hovers over the control just as it would on a normal form.

     

    Are you not seeing this?

     

    Thursday, April 3, 2008 5:09 PM
  • I found that the tooltip has to be set in the DrawItem event:

     

    Dim lblX As Label = DirectCast(e.DataRepeaterItem.Controls("lblEventDate"), Label)

    ToolTip1.SetToolTip(lblX, lblX.Tag.ToString)

     

    Friday, April 4, 2008 2:38 PM
  • I've noticed strange behavior with the tooltip.  I've added buttons to the itemTemplate of a datarepeater, added a tooltip object to the form, then set the text for the buttons, but the tooltip behavior is sporadic.  It either never shows when hovering over or sometimes shows, or will show once and then not again.  Kinda weird.

    xfratboy



    Thursday, July 3, 2008 4:30 PM
  • Correction.  This behavior only happens in the design environment.  A published project doesn't seem to experience this problem.

    btw, I'm using VB Express 08
    Thursday, July 3, 2008 5:34 PM