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 ' Stop the grid from displaying it's message box. e.DisplayPromptMsg = False ' Display our own custom message box. 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 the user clicked No on the message box, cancel the deletion of rows. If System.Windows.Forms.DialogResult.No = result Then e.Cancel = True End If End Sub
using Infragistics.Shared; using Infragistics.Win; using Infragistics.Win.UltraWinGrid; using System.Diagnostics; private void ultraGrid1_BeforeRowsDeleted(object sender, Infragistics.Win.UltraWinGrid.BeforeRowsDeletedEventArgs e) { // Stop the grid from displaying it's message box. e.DisplayPromptMsg = false; // Display our own custom message box. System.Windows.Forms.DialogResult result = 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 the user clicked No on the message box, cancel the deletion of rows. if ( System.Windows.Forms.DialogResult.No == result ) e.Cancel = true; }
Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2