Chapter 9 Customizing Data with Web Controls. ASP.NET 2.0, Third Edition2.

Slides:



Advertisements
Similar presentations
WEB DESIGN TABLES, PAGE LAYOUT AND FORMS. Page Layout Page Layout is an important part of web design Why do you think your page layout is important?
Advertisements

A Guide to Oracle9i1 Creating Database Reports Chapter 7.
Using the DetailsView and FormView Controls. Slide 2 DetailsView (Introduction) Use the DetailsView control to Display a single record at a time Insert,
Chapter 10 Database Applications Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved. McGraw-Hill.
GridView Features, DetailsView, FormView. Content GridView Features DetailsView FormView Muzaffer DOĞAN - Anadolu University2.
User Controls, Master Pages, GridView. Content User Controls Styles, Themes, Master Pages Working with Data GridView Muzaffer DOĞAN - Anadolu University2.
Creating Bindable Grids of Data. Slide 2 Lecture Overview Detailed discussion of using the GridView.
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
1 Chapter 12 Working With Access 2000 on the Internet.
1 Chapter 3 Reviewing Forms, Reports, and Data Access Pages.
Chapter 12: ADO.NET and ASP.NET Programming with Microsoft Visual Basic.NET, Second Edition.
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
Building ASP.NET Applications 2 Lecture 3,4 T. Ahlam Algharasi 4 th Level.
Introduction to ASP.NET, Second Edition2 Chapter Objectives.
Chapter 7: Creating Database Reports
Chapter 7 Managing Data Sources. ASP.NET 2.0, Third Edition2.
Microsoft Office Word 2013 Expert Microsoft Office Word 2013 Expert Courseware # 3251 Lesson 4: Working with Forms.
Tutorial 5: Working with Excel Tables, PivotTables, and PivotCharts
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Chapter 8 Binding Data to Web Controls. ASP.NET 2.0, Third Edition2.
Copyright © 2008 Pearson Prentice Hall. All rights reserved. 1 1 Committed to Shaping the Next Generation of IT Experts. Chapter 4: Create, Edit, and Perform.
Chapter 10 Managing Data with ASP.NET. ASP.NET 2.0, Third Edition2.
Unit 8.2 Learning Objectives How data can be used – The Money Ball Example The Money Ball Example Data Warehouses – The Role of Data Warehouses The Role.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
Programming with Microsoft Visual Basic 2012 Chapter 12: Web Applications.
Advanced Report and Form Techniques – Project 7. 2 Project 7 Overview This project shows how to create queries for reports, add command buttons to forms,
10-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
MSIS 5133 Advanced MIS - E-Commerce Spring 2003 Lecture 4: DotNet Technologies - Part 4 Using Controls with Databases Dr. Rathindra Sarathy.
Chapter 81 Building Data-Driven Web Applications Introduction to ASP.NET By Kathleen Kalata.
Chapter 71 Building Data-Driven ASP.NET Applications Introduction to ASP.NET By Kathleen Kalata.
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 4-1 of…
Tutorial 121 Creating a New Web Forms Page You will find that creating Web Forms is similar to creating traditional Windows applications in Visual Basic.
IT533 Lectures DataBinding Controls. Installations Microsoft® SQL Server® 2008 Express Download the sample MDF files from the course’s web site CodeWeek3.zip.
1 Data Bound Controls II Chapter Objectives You will be able to Use a Data Source control to get data from a SQL database and make it available.
1 Web-Enabled Decision Support Systems Database Connectivity in Web Applications Don McLaughlin IE 423 (304) West.
Tutorial 7 Creating Forms. Objectives Session 7.1 – Create an HTML form – Insert fields for text – Add labels for form elements – Create radio buttons.
Microsoft Visual Basic 2005 CHAPTER 7 Creating Web Applications.
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. ACCESS 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 7 – Adding and.
Chapter 4: Create, Edit, and Perform Calculations in Reports Exploring Microsoft Office Access 2007.
With Microsoft Office 2007 Introductory© 2008 Pearson Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Office 2007 Introductory.
Delivering Excellence in Software Engineering ® EPAM Systems. All rights reserved. Data Binding in ASP.NET.
Working with GridView Control: Adding Columns. Adding Buttons to a Bound GridView: 1. Drag the WebProduct table from Data connection to a page 2. Demo.
ASP.NET - accessing the database - datareader vs dataset - datagrid vs datalist - brief look at web matrix.
Chapter 8 Working With Databases in ASP.NET. Listing 8.1 – ShowListControls Uses The SqlDataSource control for estabishing database connectivity and.
ASP.NET OPTIMIZATION. Why Optimize? $$$ Whether you build applications for customers or not, enhanced applications save money.
Course ILT Forms and queries Unit objectives Create forms by using AutoForm and the Form Wizard, and add or modify form headers and footers Open and enter.
CSCI 3327 Visual Basic Chapter 13: Databases and LINQ UTPA – Fall 2011.
XP. Objectives Sort data and filter data Summarize an Excel table Insert subtotals into a range of data Outline buttons to show or hide details Create.
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
TRAINING SESSIONS.NET Controls.  Standard Controls  Label  Textbox  Checkbox  Button, Image Button, Image control  Radio Button  Literal  Hyperlink.
11 The Repeater Control. 22 Objectives You will be able to use a Repeater Control to display data obtained with a SQL query with custom formatting.
Reference: “ASP.NET 2.0 Illustrated” by Alex Homer and Dave Sussman. -ch3 illustrated book
Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall 1 1 Committed to Shaping the Next Generation of IT Experts. Chapter 4: Create, Edit,
ASP Chapter 8 1. Active Server Pages Server-side technology dynamicinteractivedata-driven Enables dynamic, interactive, data-driven web pages languages.
Microsoft Access 2013 Create Professional Quality Output with Reports Chapter 5.
Security Attacks CS 795. Buffer Overflow Problem Buffer overflow Analysis of Buffer Overflow Attacks.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
WaveMaker Visual AJAX Studio 4.0 Training Java Script Events.
1 CS 3870/CS 5870: Note07 Prog 4. Master Pages Creating a master page based on another master page MainMasterPage –For all Progs and Tests Prog4MasterPage.
1 CS 3870/CS 5870: Note07 Prog 4. Master Pages Creating a master page based on another master page MainMasterPage –For all Progs and Tests Prog4MasterPage.
Microsoft® Access Generate forms quickly 1 Modify controls in Layout View 2 Work with form sections 3 Modify controls in Design View 4 Add calculated.
Unit 8.2 Learning Objectives Data Warehouses – The Role of Data Warehouses The Role of Data Warehouses – Group Exercise Accessing Data in Views – Accessing.
Module 10: Data Access in ASP.NET. Overview Overview of the ASP.NET Data Access What is Data Access List of Data Source Control What is Data Bound How.
CHAPTER 7 LESSON C Creating Database Reports. Lesson C Objectives  Display image data in a report  Manually create queries and data links  Create summary.
1 Chapter 6: Creating Oracle Data Block Forms. 2 Forms  Application with a graphical user interface that looks like a paper form  Used to insert, update,
Exploring Microsoft Office Access 2007
Unit 8.2 How data can be used Accessing Data in Views
Listing 9.1 ShowLocalConnection.aspx
Using List Controls with SQL Server
PROG Advanced Web Apps 2/24/2019 Session 9.2 Data Binding Wendi Jollymore, ACES.
Presentation transcript:

Chapter 9 Customizing Data with Web Controls

ASP.NET 2.0, Third Edition2

 Bound data fields/columns get the data and display it from the source  Can by styled  Can specify what field to use for data  Template data fields/columns can contain controls, text, inline scripting to create the content of a cell  Ch8_dataview.aspx uses a template control to display an image rather than text ASP.NET 2.0, Third Edition3

 The templates in your Data control are the parts of the control that determine how to display specific data.  HeaderTemplate is used to configure the data contained within the header section. Instead of using the HeaderText property for the column control, you will use HeaderTemplate to modify contents of the header cell.  FooterTemplate is used to configure the data contained within the footer section.  ItemTemplate is used to configure how the row will appear in display mode. The data is actually displayed in read-only mode in this template. The GridView and DetailsView controls allow you to format the rows of data using columns.  EditItemTemplate allows you to configure the columns in edit mode. Therefore, the user can change the values of the data. Instead of editing the data using text boxes, you can use other types of controls such as check boxes and drop-down lists to edit the data. ASP.NET 2.0, Third Edition4

5

6

7

8

9

 AlternatingItemStyle — alternating rows  EditItemStyle — row being edited; the EditItemStyle is used in conjunction with the EditItemTemplate in the Data control  FooterStyle — the footer row  HeaderStyle — the header row  ItemStyle — individual items within the list or control  SelectedItemStyle — currently selected item  SeparatorStyle — content that is between each item ASP.NET 2.0, Third Edition10

 Ch9_DataList.aspx  Properties: Header style  Examine the markup ASP.NET 2.0, Third Edition11

ASP.NET 2.0, Third Edition12

ASP.NET 2.0, Third Edition13

ASP.NET 2.0, Third Edition14

 Many of the template and style techniques can also be applied to the other controls because they inherit the same classes  You can use templates to modify the Repeater control  Remember that the Repeater control repeats only once for each row of data; you cannot configure the Repeater control in Design view  Within the ItemTemplate object, you can retrieve the values of the data columns using, where ColumnName is the name of the column in the database  You can format the output using any of the standard HTML tags ASP.NET 2.0, Third Edition15

 Ch9_RepeaterTemplate.aspx  The ItemTemplate specifies how each item is to be displayed ASP.NET 2.0, Third Edition16

 Ch9_DataListTemplates.aspx  RepeatColumns  HeaderTemplate  FooterTemplate ASP.NET 2.0, Third Edition17

 The GridView control contains a collection of columns  Columns can be bound to data in the record or unbound  BoundFields are used to insert a button that can activate row-specific procedures  You can modify the button’s text and type using the LinkButton or Button properties  You can use the CommandName property to identify a procedure that is called when the button is clicked  The ItemCommand event is raised when any button is clicked within a GridView control ASP.NET 2.0, Third Edition18

 TemplateFields allows you to customize the columns in both display and edit modes  HyperLinkFields displays a hyperlink that you can customize  You can hard code the text displayed and the URL of the hyperlink, or set these properties with values from the data  ButtonFields allows you to insert buttons that will be used to execute custom commands  CommandFields contains three predefined buttons that allow you to change the mode of the row from display to edit  ImageFields allows you to bind data to image controls  CheckBoxFields allows you to customize the value as a check box ASP.NET 2.0, Third Edition19

 All BoundField columns also allow you to specify the DataField property, which identifies the column from the data source bound to the column  DataFormatString property identifies the formatting rules for the contents of the BoundField object  You must set the ReadOnly property to true for fields where you modify the DataFormatString property  ReadOnly property is used with BoundField objects to stop the user from editing a column when the GridView control is in edit mode ASP.NET 2.0, Third Edition20

 All columns within the GridView control allow you to configure the appearance of the column:  HeaderText  HeaderImageURL  FooterText properties  Visible property allows you to show or hide the column  SortExpression property is used to identify the column from the data source that is used when sorting the column ASP.NET 2.0, Third Edition21

 When you update a BoundField column, the contents of the columns are sent using GridViewCommandEventArgs ; the arguments in the column are represented with the variable e  When you want to access a specific cell within a column, you must use the Item property of the e object  The e.Item property contains an indexed Cells collection that contains one Cell object for each column in the GridView control  The columns in the GridView are numbered starting with 0  So, e.Item.Cells(0) would represent the first column in the GridView control ASP.NET 2.0, Third Edition22

 In a master-detail page, you configure the master control to pass the value to the detail control  Often the master control is the GridView control and the detail control is the DetailsView control  In this section, you will learn to create and bind a drop-down list to a field  Then when the user selects a value, another list is generated  Finally, the user selects a record from a GridView control, and the specific record data is displayed in a DetailsView control ASP.NET 2.0, Third Edition23

 Ch8_GridViewTemplate.aspx  The second field is a template field  The template field in the GridView control  Item template uses an inline expression to create a hyperlink  The footer template uses an inline expression to count the number of items displayed ASP.NET 2.0, Third Edition24

 Put numeric data into the cells rather than strings  Remove the auto-generated columns  Add bound columns corresponding to the data columns  Format the columns ASP.NET 2.0, Third Edition25

 Ch9_MasterDetails.aspx  Selections in controls at the top provide the information to filter controls farther down ASP.NET 2.0, Third Edition26

 Visual Studio allows the user to create item templates and project templates  Visual Studio stores user-defined templates separate from the application templates  User templates are templates that are only available to the individual user  When Visual Studio was installed, a folder was created for the user; this folder contains user-specific files such as the user templates ASP.NET 2.0, Third Edition27

ASP.NET 2.0, Third Edition28

ASP.NET 2.0, Third Edition29

 The DataList, Repeater, and GridView controls use an ItemTemplate to display the values. The DataList and DataGrid controls use templates to create the header, footer, and item sections of the Data control. You can format these controls using the graphical Style Builder tool or manually. The Repeater control must be edited manually in HTML view. There is no graphical tool to edit the Repeater control.  Styles are used to format the appearance of the control. You can format the control using style sheets or formatting properties within the control.  Templates are used to display the content within the control. There is header, footer, item, alternating item, and other specialized templates for each of the Data controls. You can modify the templates manually or using the graphical user interface within the web editor. ASP.NET 2.0, Third Edition30

 The GridView control allows you to create a collection of bound and unbound columns. Bound columns contain a value that is bound to a value in the database. Bound columns are referred to as BoundFields. Other types of columns include HyperLinkFields and TemplateFields. TemplateFields allow you the most flexibility. Even though the column is not bound, you can still retrieve and display the data in the column.  Master-detail pages provide a way to retrieve data that is based on a selection that the user makes in another Data control. The DataSource control uses this data to create a parameter query and binds the new data set to the Data control. Other types of data, such as a QueryString or session parameter, can also be used as a parameter for the DataSource control.  Another tool to improve your efficiency with web programming is custom templates. ASP.NET 2.0, Third Edition31