Comparison between is always most favorite ASP.NET interview questions of the interviewer in order to judge developer skills. So here we have attempted to bring in forward one comparison from ASP.NET.
So here goes the answer: -
Grid view and data grid by default display all the data in tabular format i.e. in table and rows. Developer has no control to change the table data display of datagrid.
Data list also displays data in a table but gives some flexibility in terms of displaying data row wise and column wise using the repeat direction property.
Repeater control is highly customizable. It does not display data in table by default. So you can customize from scratch the way you want to display data.
Performance wise: -
Repeater is fastest followed by Datalist/Gridview and finally data grid.
Using checkbox in a data grid: -
Following are the steps to be done:-
- In ASPX page you have to add Item template tag in data grid.
If you look at the Item template, we have “OnCheckChanged” event. This “OnCheckChanged” event has “Check Clicked” subroutine is actually in behind code. Note this method, which is in behind code, should either be “protected” or “public”
- Following below is the subroutine, which defines the method