Pregunta

I have been searching for hours and can not find a solution. i was wondering is there a way to add sql data to a tool tip in ASPX? At the moment i have a GridView which shows information from a database. The final column is a total column, i would like the tool tip to show how the total was got.

What would be the best way to do this? I am using vb codebehind for this project.

Thanks

¿Fue útil?

Solución

Make the cell of your grid view that holds the total value be a server control, like Label, and then bind the text to the ToolTip property of control like this:

<asp:Label id="LabelTotal" runat="server" ToolTip='<%# Eval("Formula") %>' />

Obviously, this means you need to have a property named "Formula" in the list of objects you are binding to your grid view or a database column named "Formula".

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top