Tooltip for all cells in one column, whit value from other cell in same row

3 posts, 0 answers
  1. Jan Skovhus
    Jan Skovhus avatar
    7 posts
    Member since:
    Mar 2014

    Posted 02 Dec 2014 Link to this post

    How can I do this whit RadGridView:

    For i = 0 To DataGridView.Rows.Count() - 1
        DataGridView.Rows(i).Cells(18).ToolTipText = "Target: " & DataGridView.Rows(i).Cells(24).Value
    Next

    Regrads Jan
  2. Jan Skovhus
    Jan Skovhus avatar
    7 posts
    Member since:
    Mar 2014

    Posted 02 Dec 2014 in reply to Jan Skovhus Link to this post

    Found the solutions:

    Private Sub DataGridView_CellFormatting(sender As Object, e As Telerik.WinControls.UI.CellFormattingEventArgs) Handles DataGridView.CellFormatting
    If e.CellElement.ColumnInfo.HeaderText = "Name" Then
    e.CellElement.ToolTipText = CellElement.RowInfo.Cells("Name2").Value
    End If
    End Sub
  3. Dimitar
    Admin
    Dimitar avatar
    2686 posts

    Posted 05 Dec 2014 Link to this post

    Hello Jan,

    Thank you for contacting us.

    Since the formating event is fired very often, better solution will be to use the ToolTipTextNeeded event of the grid:
    Private Sub radGridView1_ToolTipTextNeeded(sender As Object, e As Telerik.WinControls.ToolTipTextNeededEventArgs)
        Dim cell As GridDataCellElement = TryCast(sender, GridDataCellElement)
        If cell IsNot Nothing Then
     
            e.ToolTipText = cell.RowInfo.Cells(2).Value.ToString()
        End If
     
    End Sub

    Please let me know if there is something else I can help you with. 
     
    Regards,
    Dimitar
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top