ButtonClicked and MenuClicked Event Handlers

With the event handlers below, we call upon the SpellCheckGrid () sub routine to check the grid. By investigating the Button.Key property within the BatchButtonEventArgs and the MenuItem.Key within the BatchMenuEventArgs, we can determine which menu or button was selected.

    ''' <summary>
    ''' Occurs when a button is clicked.
    ''' </summary>
    Private Sub FoodItemAddBatchEventHandler_ButtonClicked(ByVal sender As Object, ByVal e As Browser.Batch.BatchButtonEventArgs) Handles Me.ButtonClicked

        If e.Button.Key = BUTTON_KEY Then
            SpellCheckGrid()
        End If

    End Sub

    ''' <summary>
    ''' Occurs when a menu is clicked
    ''' </summary>
    Private Sub FoodItemAddBatchEventHandler_MenuClicked(ByVal sender As Object, ByVal e As Browser.Batch.BatchMenuEventArgs) Handles Me.MenuClicked

        If e.MenuItem.Key = BUTTON_KEY Then
            SpellCheckGrid()
        End If

   End Sub

To see the creation of the DataFormItem as part of a batch web API automation sample, see Using the AppFxWebService to Add Rows to Batch.