Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid
Private Sub UltraGrid1_BeforeDisplayDataErrorTooltip(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.BeforeDisplayDataErrorTooltipEventArgs) Handles UltraGrid1.BeforeDisplayDataErrorTooltip
' You can get the instance of the IDataErrorInfo that provided the UltraGrid
' with the error using the DataErrorInfo property.
Dim dataErrorInfo As System.ComponentModel.IDataErrorInfo = e.DataErrorInfo
' You can get the underlying list object using the row's ListObject property.
Dim listObject As Object = e.Row.ListObject
' If the UltraGrid is bound to a DataSet or DataTable then the listObjects
' are instances of DataRowView. You can get the underlying DataRow from it.
Dim drv As DataRowView = Nothing
Dim dataRow As DataRow = Nothing
If TypeOf listObject Is DataRowView Then
drv = DirectCast(listObject, DataRowView)
dataRow = drv.Row
End If
' You can modify the tooltip text by setting the TooltipText property.
If Not Nothing Is e.Column Then
' If Column is non-null then the tooltip is being displayed for the
' error icon of a cell.
e.TooltipText = "Cell Data Error Tooltip for " & e.Column.Key & ": " & e.TooltipText
Else
' If the Column is null then the tooltip is being displayed for the
' error icon of a row selector.
e.TooltipText = "Row Data Error Tooltip: " & e.TooltipText
End If
' You can conditionally prevent the displaying of the tooltip by setting
' the Cancel to true.
If e.TooltipText.Length > 10000 Then
e.Cancel = True
End If
End Sub