This is a migrated thread and some comments may be shown as answers.

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

2 Answers 18 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jan Skovhus
Top achievements
Rank 1
Jan Skovhus asked on 02 Dec 2014, 12:26 PM
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 Answers, 1 is accepted

Sort by
0
Jan Skovhus
Top achievements
Rank 1
answered on 02 Dec 2014, 03:04 PM
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
0
Dimitar
Telerik team
answered on 05 Dec 2014, 09:07 AM
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.

 
Tags
GridView
Asked by
Jan Skovhus
Top achievements
Rank 1
Answers by
Jan Skovhus
Top achievements
Rank 1
Dimitar
Telerik team
Share this question
or