Asp.Net DataGrid View Interview Questions and Answers - 1
What is datagrid?
The DataGrid Web server control is a powerful tool for displaying information from a data source.
It is easy to use; you can display editable data in a professional-looking grid by setting only a few properties.
At the same time, the grid has a sophisticated object model that provides you with great flexibility in how you display the data.
The Web UI control does not inherently support master-detail data structures.
As with other Web server controls, it does not support two-way data binding.
If you want to update data, you must write code to do this yourself.
You can only edit one row at a time. It does not inherently support sorting; although it raises events you can handle in order to sort the grid contents. You can bind the Web Forms DataGrid to any object that supports the IEnumerable interface.
The Web Forms DataGrid control supports paging.
It is easy to customize the appearance and layout of the Web Forms DataGrid control as compared to the Windows Forms one.
How do you hide the columns?
One way to have columns appear dynamically is to create them at design time, and then to hide or show them as needed. You can do this by setting a column’s “Visible” property.
How do you customize the column content inside the datagrid?
If you want to customize the content of a column, make the column a template column.
Template columns work like item templates in the DataList or Repeater control, except that you are defining the layout of a column rather than a row.
How do you check whether the row data has been changed?
The definitive way to determine whether a row has been dirtied is to handle the changed event for the controls in a row. For example, if your grid row contains a TextBox control, you can respond to the control’s TextChanged event.
Similarly, for check boxes, you can respond to a CheckedChanged event. In the handler for these events, you maintain a list of the rows to be updated.
Generally, the best strategy is to track the primary keys of the affected rows.For example, you can maintain an ArrayList object that contains the primary keys of the rows to update.
7000+ Direct and Indirect Speech worksheets with Answers More
7000+ Phrasal Verbs Quiz with Answers Pdf More
7000+ Multiple Choice Questions on Phrasal Verbs with Answers Pdf More
7000+ Linkers in English Grammar 2024 - 2025 Exercises Pdf More
7000+ Linkers and Connectors Exercises with Answers Pdf More
1000+ Applied Mechanics Questions and Answers Pdf More
Famous Personalities Online Test 2020-2021 More
1000+ Free Aptitude Test Questions and Answers Pdf More
1000+ Maths Logical Puzzles Questions and Answers More
100+ Ratio and Proportion Questions for SBI PO, SO, Clerk Exams More