nerdexam
Microsoft

70-511 · Question #8

You are developing a Windows Forms application that contains a DataGridView control. The DataGridView is composed of several fields that capture the customer's name, address, and phone number. You…

The correct answer is A. Validate the name field in the CellValidating event. See the full explanation below for the reasoning.

Question

You are developing a Windows Forms application that contains a DataGridView control. The DataGridView is composed of several fields that capture the customer's name, address, and phone number. You have been asked to provide data validation in a DataGridView to prevent users from leaving the name field if the name field is empty. You need to ensure that users cannot tab out of the name field without entering data. What should you do?

Options

  • AValidate the name field in the CellValidating event.
  • BValidate the name field in the CellErrorTextChanged event.
  • CValidate the name field in the CellEnter event.
  • DValidate the name field in the CancelRowEdit event.

How the community answered

(21 responses)
  • A
    71% (15)
  • B
    14% (3)
  • C
    10% (2)
  • D
    5% (1)

Community Discussion

No community discussion yet for this question.

Full 70-511 Practice