Which is a property of the DataGrid control?

  1. DataMember

  2. DataSource

  3. DataQuery

  4. Both a and b.

  5. All of the above.


Correct Option: D
Explanation:

The correct answer is (D) Both a and b.

The DataGrid control has two properties that allow you to bind it to a data source:

  • DataSource: This property specifies the data source that the DataGrid will be bound to. The data source can be a DataSet, DataTable, or any other object that implements the IBindingSource interface.
  • DataMember: This property specifies the data member in the data source that the DataGrid will display.

The DataQuery property is not a property of the DataGrid control. It is a property of the BindingSource object that is used to bind the DataGrid to a data source.

Here is an explanation of each option:

  • Option A (DataSource): This is a property of the DataGrid control that specifies the data source that the DataGrid will be bound to. The data source can be a DataSet, DataTable, or any other object that implements the IBindingSource interface.
  • Option B (DataQuery): This is not a property of the DataGrid control. It is a property of the BindingSource object that is used to bind the DataGrid to a data source.
  • Option D (Both a and b): This is the correct answer because the DataGrid control has two properties that allow you to bind it to a data source: DataSource and DataMember.
  • Option E (All of the above): This is not the correct answer because DataQuery is not a property of the DataGrid control.
  • Option C (DataMember): This is a property of the DataGrid control that specifies the data member in the data source that the DataGrid will display.

Find more quizzes: