Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid
  Private Sub UltraGrid1_BeforeRowsDeleted(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.BeforeRowsDeletedEventArgs) Handles ultraGrid1.BeforeRowsDeleted
      ' グリッドのメッセージ ボックスの表示を回避します
      e.DisplayPromptMsg = False
      ' カスタム メッセージ ボックスを表示します
      Dim result As DialogResult = System.Windows.Forms.MessageBox.Show( _
              "Deleting " & e.Rows.Length.ToString() & " row(s). Continue ?", _
              "Delete rows?", _
              System.Windows.Forms.MessageBoxButtons.YesNo, _
              System.Windows.Forms.MessageBoxIcon.Question)
      ' メッセージ ボックスで [いいえ] がクリックされた場合、行の削除をキャンセルします
      If System.Windows.Forms.DialogResult.No = result Then
          e.Cancel = True
      End If
  End Sub