Site Search:
Sign in | Join | Help

This Blog

Syndication

ASP.NET

Notes, Tricks and Tips on ASP.NET Coding

September 2007 - Posts

  • How to add a tool tip to an ASP.NET Datagrid

    Very simple. Here is the code

         Protected Sub Grid1_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles Grid1.ItemDataBound
            If Not e.Item.DataItem Is Nothing Then
                Dim intBalToAlloc As Int64
                Dim intNoHoldQty As Int64
    
    
                Dim strTable As String
                intBalToAlloc = DataBinder.Eval(e.Item.DataItem, "balToAlloc").ToString
                intNoHoldQty = DataBinder.Eval(e.Item.DataItem, "intSuborderQtyRemainingNoHolds").ToString
    
    
                strTable = "Balance to Allocate:" & intBalToAlloc & vbCrLf
                strTable += "NoHold Qty Remaining: " & intNoHoldQty & vbCrLf
                e.Item.Cells(8).ToolTip = strTable
                e.Item.Cells(9).ToolTip = strTable
                e.Item.Cells(10).ToolTip = strTable
                e.Item.Cells(11).ToolTip = strTable
    
    
            End If
        End Sub