Link to home
Start Free TrialLog in
Avatar of malc77
malc77Flag for United States of America

asked on

Changing Background color and borders ASP.Net DataGrid's ToolTip

I'm using ASP.Net (VB.Net) 2005. Working specifically with the Telerik RadGrid which is inherited from Microsoft's Datagrid.  I am reading my ToolTips from xml which I convert into a dataset and bind to the grid.  That part works fine.  My question is: What is an easy way to add a style to the ToolTip on the datagrid?  For example my tooltip's background needs to be blue with black borders. Here is a sniplet of how I am binding the data to the templategridcolumn and tooltip:
'******************Client side Code ******************************************
 <radG:GridTemplateColumn DataField="DESC"  Groupable="False" UniqueName="DESC" >
                            <ItemStyle horizontalalign="Left" VerticalAlign="Middle" Height="20px"></ItemStyle>
                            <headertemplate>T</headertemplate>
                            <itemtemplate>                                
                            <asp:Label id="lblDes" Runat="server"   ToolTip='<% #GetToolTip(Container.DataItem ,"DESC")%>'>
                            <%#FormatColumn(Container.DataItem, "DESC")%></asp:Label>
                            </itemtemplate>
                        </radG:GridTemplateColumn>

'*******************Code Behind**************
 Public Function GetToolTip(ByVal dRowView As DataRowView, ByVal colName As String, Optional ByVal desc As String = "") As String
        If (dRowView.Row.Table.Columns.Contains(colName)) Then
            If (Not IsDBNull(dRowView.Row.Item(colName))) Then
                If (colName = "DESC") Then
                    If (CType(dRowView.Row.Item(colName), String) = "FW") Then
                        Return "Forward Align"
                    ElseIf (CType(dRowView.Row.Item(colName), String) = "RE" Or CType(dRowView.Row.Item(colName), String) = "RW") Then
                        Return "Rear Wheel"
                    ElseIf (CType(dRowView.Row.Item(colName), String) = "BW") Then
                        Return "Back Wheel"
                    End If
                Else
                    Return desc
                End If
            Else
                Return String.Empty
            End If
        Else
            Return String.Empty
        End If
    End Function
ASKER CERTIFIED SOLUTION
Avatar of Argblat
Argblat

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial