Custom Search

Monday, August 4, 2008

Displaying Data with the DetailsView Control

If you want to display a single record of data in a table form with the field names in the left column and the field data in the right column, then the DetailsView control is for you. A DetailsView control renders an HTML table that displays the contents of a single database record. The DetailsView supports both declarative and programmatic databinding.

If you need more control over the appearance of the DetailsView, including the particular order in which columns are displayed, then you can use fields with the DetailsView control. The DetailsView control supports exactly the same fields as the GridView control:

  • BoundField Enables you to display the value of a data item as text.

  • CheckBoxField Enables you to display the value of a data item as a check box.

  • CommandField Enables you to display links for editing, deleting, and selecting rows.

  • ButtonField Enables you to display the value of a data item as a button (image button, link button, or push button).

  • HyperLinkField Enables you to display the value of a data item as a link.

  • ImageField Enables you to display the value of a data item as an image.

  • TemplateField Enables you to customize the appearance of a data item

Additionally, the DetailsView control contains a field called DataKeyNames.This is a string that represents the name of the primary key field in the data source.

No comments:

Free Traffic

 Join My Community at MyBloglog! Blog Flux Directory 

Web Developement Blogs - BlogCatalog Blog Directory web development blog  Internet Blogs - Blog Top Sites 

Blog Directory 

Click Here for Free Traffic!

Link2Communion.com