show tooltip in gridview

G

graphicsxp

Hi,

I would like to show a tooltip when the user move the mouse over the
first column of my gridview.

The tooltip should be bound to a field of the gridview's datasource
that correspond to the row being hovered.

How can I do that ?
 
T

Tasos Vogiatzoglou

Either you put a link with the title attribute set, or you should
devise a DHTML method (that includes javascript).

Regards,
Tasos
 
P

Patrick.O.Ige

You can use a label control
and in the label control set ToolTip='blablabls'
Patrick
 
G

graphicsxp

I've found a better way actually :

Protected Sub grdCuttings_RowDataBound(ByVal sender As Object, ByVal e
As System.Web.UI.WebControls.GridViewRowEventArgs) Handles
grdCuttings.RowDataBound
Dim item As GridViewRow = e.Row

If (e.Row.RowType = DataControlRowType.DataRow) Then
item.Cells(0).Attributes.Add("title",
Me.grdCuttings.DataKeys(item.RowIndex).Item("Headline").ToString())
End If
End Sub

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top