How do we add customized columns in a Gridview in ASP.NET?

Make use of the TemplateField column.

What are the steps to use a checkbox in a gridview?

<asp:CheckBox id=”CheckBox1″ runat=”server” AutoPostBack=”True”

Difference between datagrid and GridView?

1.Code requires to handle the SortCommand event and rebind grid required.
2.Code requires to handle the PageIndexChanged.
3.Need extensive code for update operation on data.
4.When compared to gridview less events supported.

1.No code required.
2.No code required for PageIndexChanged.
3.Needs little code for update operation.
4.GridView supports events fired before and after database updates

Listview in

ListView is a data bound control similar to DataList and DataRepeater controls but it provides edit, insert, and delete , sort operations on the data that it bounded like a GridView control. Unlike GridView control ListView gives the user full control over the rendering of the page. using templates and styles(CSS) the user can generate clean HTML UI according to his needs.

How do you hide the columns of a gridview?

By setting a column’s Visible property of a column as false or by the style display:none property.

How To Create GridView With ScrollBars?


Difference between Datalist and Gridview.

Gridview support’s selection, editing , sorting and paging whereas Datalist can’t support sorting and paging but support selection and editing