Home | HTML | Asp.Net | HTML Probe | .Net Probe
   
 www.solvingera.com 
  Contact Us |Sitemap
  
 

Data Bound Controls in Asp.Net

Skip Navigation LinksHome>Asp Home>Data Bound Controls
Data Bound controls are used to display data from the DataBase. There are several controls which explained below:-

GridView

The GridView control is a control that is used to display the data in tabular form. In this form, each column represents a field and each row represents a record. With this GridView control, a developer can display an entire collection of data and add sorting or paging option in the table. This control also allows editing and deleting data from database. The GridView control exists within the System.Web.UI.WebControls namespace.

Column Field Type of GridView Class:
  • BoundField: This column displays the value of a field in the data source. It is the default column type.

  • ButtonField : This column displays a button for each item in the list.

  • CheckBoxField : This column shows a check box for each item in the list.

  • CommandField : This column perform selection, editing or deleting operation.

  • HyperLinkField : It shows a value of data source content as a hyperlink.

  • ImageField : It displays an image for each item.

  • TemplateField : It is used to create a customized column field.
GridView example for Insert, Update, Edit, Delete data

GridView example for Update, Edit, Delete data by Wizard method

ListView

The ListView data bound control is used to display data in any format using templates and styles. This control enables a developer to edit, insert, delete and sort the page data. The ListView control provides different types of templates and styles according to user requirement. By default, the ListView control has no layout. So to use ListView control, you need to configure ListView by selecting a template and style as a screenshot is given below.

The DetailsView

The DetailsView data bound control is a control that is used to display a single record at a time. It places each piece of information in a separate row of a table. DetailsView control also supports insert, update and delete operations. The DetailsView control exists within the System.Web.UI.WebControls namespace.

Here is an explanation how can you use DetailsView control in your web application.

The FormView

Similar to DetailsView control, the FormView control is a control that is used to display a single record at a time. Each row of the table displays each field of the record. A developer can modify the layout of FormView for displaying the record. The FormView control exists within the System.Web.UI.WebControls namespace.

There are several templates that are supported by FormView control are given below:
  • EditItemTemplate: It contains input controls and command buttons to edit the existing record.

  • ItemTemplate : It puts the FormView into edit mode.

  • InsertItemTemplate: This template is used to add a new record.

  • FooterTemplate : This template is used to describe the footer message which a developer wants to display in the footer row.

  • HeaderTemplate: This template is used to describe the header message which a developer wants to display in the header row.

  • EmptyDataTemplate: This template is used to display the message for the data row that does not contain any record.

  • PagerTemplate: This template is used to describe the content for pager row.
Here is an explanation how can you use FormView control in your web application.

DataList Control

The DataList control is a control that is used to display the data rows in a changeable format by using templates. The DataList control exists within the System.Web.UI.WebControls namespace.

There are several templates that are supported by DataList control are given below:
  • AlternatingItemTemplate: It provides the format and content for alternating cell.

  • EditItemTemplate: It provides the format and content for the item to be edited.

  • FooterTemplate : This template is used to describe the footer message which a developer wants to display in the footer row.

  • HeaderTemplate: This template is used to describe the header message which a developer wants to display in the header row.

  • ItemTemplate : It provides the format and content for items in DataList Control.

  • SelectedItemTemplate: It is used to set the format of selected items in DataList Control.

  • SeparatorTemplate: It is used to separate data rows from each other with a customizable format and content.
Here is an explanation how can you use DataList control in your web application.

DataPager Control

The DataPager control is used to provide a paging functionality to data bound controls so that a user can go to Next page or Back page.

Some important properties of DataPager class are given below:
  • Fields: Fields is a collection of DataPagerField objects that represent the pager fields.

  • PagedControlID: Sets the ID of control that contains data to be paged.

  • PageSize: Sets the number of records that are to be displayed for each page.

The RepeaterControl

The Repeater control is a data bound control that is used to display data by using customized layouts. This control does not support in-built layout or style. This control does not have a default layout, so you need to declare all layout or styles to use this control. The RepeaterControl is very helpful to display data in the form of table, grid and bulleted list or other format. The RepeaterControl exists within the System.Web.UI.WebControls namespace.

Some important properties of DataPager class are given below:
  • AlternatingItemTemplate: It defines how alternating items in the control are displayed.

  • DataMember: Sets a table in database to bind to the repeater control.

  • DataSource: Sets the data source that provides data for populating the list.

  • DataSourceID: Sets the ID of the Data source control that is used by the repeater to retrieve its data source.
 
 
 
     
     
  
DMCA.com Protection Status
Design & Maintain By solvingera group| solvingera.com © 2013-2014 | all right reserved |Privacy Policy | Back to top