'宣言 Public Event BeforeDisplayDataErrorTooltip As BeforeDisplayDataErrorTooltipEventHandler
public event BeforeDisplayDataErrorTooltipEventHandler BeforeDisplayDataErrorTooltip
イベント ハンドラが、このイベントに関連するデータを含む、BeforeDisplayDataErrorTooltipEventArgs 型の引数を受け取りました。次の BeforeDisplayDataErrorTooltipEventArgs プロパティには、このイベントの固有の情報が記載されます。
プロパティ | 解説 |
---|---|
Cancel System.ComponentModel.CancelEventArgsから継承されます。 | |
Column | データ エラー ツールヒントが行に対して表示される場合(ユーザーが行セレクターのデータ エラー アイコンの上にマウスを置いた場合)、Column は null になります。データエラーツールヒントがセルに対して表示される場合、このプロパティは関連付けられた列を返します。 |
DataErrorInfo | 関連付けられたIDataErrorInfoインスタンス。 |
Row | データエラーツールヒントが表示される対象の行を返します。 |
TooltipText | データエラーツールヒントに表示されるテキストを取得または設定します。 |
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
using Infragistics.Shared; using Infragistics.Win; using Infragistics.Win.UltraWinGrid; using System.Diagnostics; private void UltraGrid1_BeforeDisplayDataErrorTooltip(object sender, Infragistics.Win.UltraWinGrid.BeforeDisplayDataErrorTooltipEventArgs e) { // You can get the instance of the IDataErrorInfo that provided the UltraGrid // with the error using the DataErrorInfo property. System.ComponentModel.IDataErrorInfo dataErrorInfo = e.DataErrorInfo; // You can get the underlying list object using the row's ListObject property. object listObject = 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. DataRowView drv = null; DataRow dataRow = null; if ( listObject is DataRowView ) { drv = (DataRowView)listObject; dataRow = drv.Row; } // You can modify the tooltip text by setting the TooltipText property. if ( null != e.Column ) { // 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; } // You can conditionally prevent the displaying of the tooltip by setting // the Cancel to true. if ( e.TooltipText.Length > 10000 ) { e.Cancel = true; } }