Download presentation
Presentation is loading. Please wait.
Published byFranklin Bates Modified over 9 years ago
1
TRAINING SESSIONS.NET Controls
2
Standard Controls Label Textbox Checkbox Button, Image Button, Image control Radio Button Literal Hyperlink Panel
3
Validation Controls Required Field Validator Range Validator Compare Validator Regular Expression Validator Custom Validator Validation Summary
4
Datasource Controls SQL Datasource XML Datasource Object Datasource Access Datasource Sitemap Datasource
5
Data Bound Controls Grid View List View Details View Form View Repeater Data List Drop Down List
6
Displays tabular data Display, edit, and delete data from many different kinds of data sources, including databases, XML files, and business objects that expose data. Automatically bind to and display data from a data source control. Select, sort, page through, edit, and delete data from a data source control. Specifying custom columns and styles. Adding your own code to the functionality of the control by handling events. Grid View
7
DatasourceID Bind to datasource control DataSource Bind to various objects Datasets Data tables Collections Grid View - Data binding
8
Grid View - Data binding using DatasourceID
9
Grid View - Data binding using DataSource
11
Enable AllowSorting property to true Setting PageSize for paging Grid View - Sorting
12
Enable AllowPaging property to true Column headers are rendered as links for sorting the data in ascending or descending order When using explicitly specified fields with a GridView, such as BoundFields, you need to specify values for the fields’s SortExpression properties. Otherwise, nothing happens when you click a header. Grid View - Paging
13
Enables you to edit database data Without writing single line of code Grid View – Editing and Deleting Data Set AutoGenerateEditButton and AutoGenerateDeleteButton to true Set DataKeyNames property to Primary key of the database table UpdateCommand and DeleteCommand are to be specified in the SQLDataSource being used
14
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. Grid View – Fields
15
BoundField—Display the value of data item as text. CheckBoxField—Display the value of 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 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. Grid View – Fields
16
Renders HTML table Displays the contents of single database record Detail View
17
Display, edit, and delete data single record at a time. Specifying custom columns and styles. Adding your own code to the functionality of the control by handling events. Detail View
18
DatasourceID Bind to datasource control DataSource Bind to various objects Datasets Data tables Collections Detail View - Data binding
19
Detail View - Data binding using DatasourceID
20
Detail View - Data binding using DataSource Client Side Code Server Side Code
21
Similar to Detail View. Template Driven Form View
22
Form View - Data binding using DatasourceID
23
Entirely template driven Produces list of individual items The control repeats the layout for each item in the data source. Repeater
24
Repeater- Data binding using DatasourceID
25
Repeater- Templates ItemTemplate —Formats each item from the data source. AlternatingItemTemplate—Formats every other item from the data source. SeparatorTemplate—Formats between each item from the data source. HeaderTemplate—Formats before all items from the data source. FooterTemplate—Formats after all items from the data source.
26
Entirely template driven Renders HTML table Supply the control with an ItemTemplate. The contents of the ItemTemplate are rendered for each data item from the data source. DataList
28
The RepeateLayout Property Table – Data Items are rendered in HTML Table cells Flow - – Data Items are rendered in HTML Span tags Render contents in Multi- Column table RepeatColumns – No of columns RepeatDirection – Direction of repeat (Horizontal/Vertical) Editing in DataList is different, it requires programmatic approach DataList
29
Super flexible GridView Control Entirely Template Driven Used to display, edit, delete and sort database data Displays database records in multiple columns Similar to the DataList and Repeater controlsDataListRepeater Unlike those controls, with the ListView control you can enable users to edit, insert, and delete data, and to sort and page data, all without code.ListView You can group items using Group Template List View
30
Learn and prepare document for Standard Controls Difference between data controls Implement a Grid View using DatasourceID DataSource Implement Edit/Delete and Sort/Paging functionality in Grid View Explore events of Grid View Implement simple functionality of all controls listed in this ppt
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.