Tooltip - binding...

P

Paul Aspinall

Hi
Is it possible to also bind to the Tooltip property of the control, when
binding the data to the control??

I have a Dataset which contains various bits of data. When a user hovers
over a row, or cell, I want to display a tooltip, which has been bound from
the Dataset.
This will vary from Cell to cell, or maybe row to row.

Does anyone have an example of how to do this?

Thanks
 
S

Stevie_mac

Handle the datagrids ItemDataBound
example...

Private Sub DataGrid1_ItemDataBound(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs) Handles
DataGrid1.ItemDataBound
If e.Item.Cells(0).Text = "Fault"
e.Item.Cells(0).ToolTip = "There is a fault in the CMOS Chip IC08, Check
that pin 7 has +ve & pin 1 is grounded"
e.Item.Cells(0).BackColor = Color.Red
Else
e.Item.Cells(0).ToolTip = "The CMOS Chip IC08 is healthy..."
e.Item.Cells(0).BackColor = Color.Green
End If

If e.Item.Cells(1).Text = "Fault"
e.Item.Cells(1).ToolTip = "There is a fault in the TTL Chip IC12, Check
that pin 5 has +5v and Pin 6 is grounded"
e.Item.Cells(1).BackColor = Color.Red
Else
e.Item.Cells(1).ToolTip = "The TTL Chip IC12 is healthy..."
e.Item.Cells(1).BackColor = Color.Green
End If
End Sub
 

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

Members online

Forum statistics

Threads
474,135
Messages
2,570,787
Members
47,342
Latest member
KelseyK737

Latest Threads

Top