Wednesday, October 24, 2012

DataBound Control in .NET

A web application or window application is worthy when we introduce data access in the application and its mapping with application. To map data access to our application .net framework provides DataBound control.

DataBound control is used to show data in our application with the help of DataSource control. DataBound control can be used to display data and modify data according to requirement in our application.
We can work with a DataBound control by binding it to a DataSource control such as SqlDataSource or ObjectDataSource or AccessDataSource or LinqDataSource or XmlDataSource or EntityDataSource or SiteMapDataSorce control.The DataSource control connects to a data source such as database or xml or middle tier object and then retrieves or updates data.

There are three types of DataBound controls:
1. List control
2. Tabular control
3. Hierarchical control.

List control
There are five types of list control:
1. CheckBoxList
2. RadioButtonList
3. BulletedList
4. DropDownList
5. ListBox
CheckBoxList
It is used to display a list of check boxes and multiple selections can be possible.
RadioButtonList
It is used to display a list of radio buttons and only one selection can be possible.
BulletedList
It is used to display a bulleted list of items. Each item can be displayed a text or a link button or a hyperlink.
DropDownList
It is used to display a dropdown list. Only one item in the dropdown list can be selected.
ListBox
It is used to display a list box and multiple selections can be possible but depends on configuration that we define on items.

Tabular Control
There are six types of tabular control:
1. GridView
2. DataList
3. Repeater
4. ListView
5. DetailsView
6. FormView
Notes: GridView, DataList, Repeater and ListView display multiple data items at a time whereas DetailsView and FormView display single data at a time.
GridView
It is used to display a set of data items in a HTML table.We can use this control to display all the records contained in the table. This control supports sorting, paging and editing data.
DataList
It is used to display a set of data items in an HTML table. Unlike the GridView control, more than one data item can display in a single row.
Repeater
It is used to display a set of data items using a template. Unlike the GridView and DataList controls, this control does not automatically render an HTML table.
ListView
It is used to display a set of data items using a template. Unlike the Repeater control, this control supports sorting, paging and editing data.
DetailsView
It is used to display a single data item in an HTML table. We can use this control to display a single record contained in the table. This control supports sorting, paging, adding and editing data.
FormView
It is used to display a single data item using a template. Unlike the DetailsView ,this control allows to use to layout a form by using templates.

Hierarchical control
There are two types of hierarchical control:
1. Menu
2. TreeView
Menu
It is used to display a single data item in a static or dynamic menu.
TreeViewIt is used to display a single data item in a tree.

No comments:

Copyright © Codingnodes,2014.All Rights Reserved.