Confirm Row Deletion When Using the Devexpress Gridview EmbeddedNavigator

Posted On // Leave a Comment

  1. To do this, I need to handle the ButtonClick event of the embedded navigator.
  2. select the grid control, in the events list, I expand the EmbeddedNavigator node and doubleclick to create a handle for the ButtonClick event.
  3.  Since the Embedded Navigator is part of the XtraEditors Library, I’m first going to add a 
  4. reference to the DevExpress.XtraEditors namespace.
  5. Now I’m going to add the following code to the event handler
Private Sub GridControl1_EmbeddedNavigator_ButtonClick(ByVal sender As System.Object, ByVal e As DevExpress.XtraEditors.NavigatorButtonClickEventArgs) Handles GridControl1.EmbeddedNavigator.ButtonClick
        If e.Button.ButtonType = NavigatorButtonType.Remove Then
            If XtraMessageBox.Show(_LookAndFeel, "Anda yakin mau menghapus data?", Me.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question) = Windows.Forms.DialogResult.No Then
                e.Handled = True
            End If
        End If
    End Sub

0 komentar: