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.

Slides:



Advertisements
Similar presentations
Database Basics. What is Access? Database management system Computer-based equivalent of a manual database Makes it easy to organize and update information.
Advertisements

Jeopardy Objects Navigation Buttons True/False Parts of a Report Vocabulary Q $100 Q $200 Q $300 Q $400 Q $500 Q $100 Q $200 Q $300 Q $400 Q $500 Final.
Chapter 10 Database Applications Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved. McGraw-Hill.
Chapter 9 Customizing Data with Web Controls. ASP.NET 2.0, Third Edition2.
Chapter 18 - Data sources and datasets 1 Outline How to create a data source How to use a data source How to use Query Builder to build a simple query.
Access Lesson 2 Creating a Database
Integrating Access with the Web and with Other Programs.
Chapter 12: ADO.NET and ASP.NET Programming with Microsoft Visual Basic.NET, Second Edition.
Shopping Cart Demo. Shopping Cart Search and display product information Add item to cart View cart contents Check out Note: WebsiteCart.
Access Tutorial 1 Creating a Database
Introduction to ADO.Net, VB.Net Database Tools and Data Binding ISYS 512.
Netscape Composer Add A Custom Button. Launch Composer File>New Composer Page Select The Table Icon.
Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 1 Lab10 Interacting with Data (Database Management)
Introduction to ADO.Net and Visual Studio Database Tools ISYS 512.
Introduction to ADO.Net, VB.Net Database Tools and Data Binding ISYS 512.
Introduction to ADO.Net, VB.Net Database Tools and Data Binding ISYS 512.
Microsoft Access 2007 Microsoft Access 2007 Introduction to Database Programs.
Introduction to ADO.Net and Visual Studio Database Tools
Tutorial 1 Creating a Database. Objectives Learn basic database concepts and terms Learn basic database concepts and terms Explore the Microsoft Access.
Tutorial: Introduction to ASP.NET Internet Technologies and Web Application 4 th February 2010.
CHAPTER 9 DATABASE MANAGEMENT © Prepared By: Razif Razali.
BIM211 – Visual Programming Database Operations II 1.
Introduction to ADO.Net and Visual Studio Database Tools ISYS 512.
10-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
McGraw-Hill/Irwin Programming in Visual Basic 6.0 © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Update Edition Chapter 11 Accessing Database.
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.
Course ILT Access basics Unit objectives Define database and database-related terminology, and plan a database Start Access and open, create, view, and.
1 By: Nour Hilal. Microsoft Access is a database software where data is stored in one or more Tables. A Database is a group of related Tables. Access.
CSCI 6962: Server-side Design and Programming Database Manipulation in ASP.
Pasewark & Pasewark Microsoft Office 2003: Introductory 1 INTRODUCTORY MICROSOFT ACCESS Lesson 3 – Creating and Modifying Forms.
® Microsoft Office 2013 Access Creating a Database.
Windows Forms Navigating database with windows forms.
Using Adapter Wizard ISYS 512. Data Adapter Wizard – 2 nd Level of Using ADO.Net Configure Data Adapter and generating a dataset: –From the Data tab of.
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.
1 Chapter 20 – Data sources and datasets Outline How to create a data source How to use a data source How to use Query Builder to build a simple query.
Pasewark & Pasewark Microsoft Office 2003: Introductory 1 INTRODUCTORY MICROSOFT ACCESS Lesson 3 – Creating and Modifying Forms.
TRAINING SESSIONS.NET Controls.  Standard Controls  Label  Textbox  Checkbox  Button, Image Button, Image control  Radio Button  Literal  Hyperlink.
Introduction to a Database Defining a database Database window in Access The six items in window: Tables, Queries Forms, Reports, Macros, Modules.
Introduction to ADO.Net and VS Database Tools and Data Binding ISYS 350.
Microsoft Excel 2003 Illustrated Complete Data with Other Programs Exchanging.
CS 281 – Fall 2015 Lab 4 Parametric Query and Forms in MS Access.
INTRODUCTION TO ACCESS. OBJECTIVES  Define the terms field, record, table, relational database, primary key, and foreign key  Create a blank database.
MSOffice Access Microsoft® Office 2010: Illustrated Introductory 1 Part 1 ® Database & Table.
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.
ADO.NET Objects Data Adapters Dr. Ron Eaglin. Agenda Builds on Information in Part I Should have working knowledge of creating a database connection Continuation.
XP New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 8 1 Microsoft Office Access 2003 Tutorial 8 – Integrating Access with the.
Understand Databound Controls Windows Development Fundamentals LESSON 4.2A.
Introduction to ADO.Net and Visual Studio Database Tools ISYS 350.
Chapter 28. Copyright 2003, Paradigm Publishing Inc. CHAPTER 28 BACKNEXTEND 28-2 LINKS TO OBJECTIVES Table Calculations Table Properties Fields in a Table.
COMPREHENSIVE Access Tutorial 1 Creating a Database.
Adding a Picture in ArcGIS. Getting Started Open ArcMap in ArcGIS Add shape files Find pictures on the web save in folder with shape files you added to.
CS 281 – Fall 2010 Lab 4 Parametric Query and Forms in MS Access.
1 Access Lesson 1 Understanding Access Fundamentals Microsoft Office 2010 Fundamentals Story / Walls.
Creating SQL Database file And Displaying a Database Table in a DataGridView.
Shopping Cart Demo. Shopping Cart Search and display product information Add item to cart View cart contents Check out.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 11 Creating Web Applications and Writing Data to a Database.
Creating Data Base & Sql Data Source
Access Tutorial 1 Creating a Database
Access Tutorial 1 Creating a Database
Access Lesson 2 Creating a Database
© 2016, Mike Murach & Associates, Inc.
Creating Data Base & Sql Data Source
Access Tutorial 1 Creating a Database
Access Tutorial 1 Creating a Database
Netscape Composer Add A Custom Button.
Introduction to ADO.Net and Visual Studio Database Tools.
Presentation transcript:

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 Enable Sorting,Editing,Deleting,Selection

Edit Columns –Bound Fields –Command Fields: Edit, update, cancel Select Delete –Template Fields Example: –Click GridView ’ s smart tag and click: Enable Edit –Update, Cancel –ASP.Net will execute the command automatically.

Rearrange the Fields Order Click GridView ’ s smart tag Select Edit Columns option Use the Up/Down button of the Selected Fields window to rearrange fields order

Create a bound gridView with a textbox and a button

Enable Select Click GridView’s smart tag and click: Enable Select –This will add a Select field to the gridview which is a type of command field. Click Edit Columns Click the Select field from the Selected Fields window to edit its property: –Button type property: Button Link –“Select text” property: AddToCart

Adding Textbox to a Bound DataGrid GridView smart tag/Add New Column: –From the Available Fields list, select Template fields and click Add: HeaderText: This text will be used as column name Click OK - Edit Template –Drag a textbox to the template window. Click the smart tag and select End Edit Template

Select Button Select button will trigger GridView ’ s SelectedIndexChange event. Use this event we can retrieve the value of every cell in the selected row. We can use this button to retrieve value entered in the Quantity textbox. Properties: –GridView1.SelectedIndex –GridView1.SelectedRow.Cells[Index] 0-based index

Command Field: Select Select a row and trigger event: –SelectedIndexChanged Retrieve the selected row: –GridView1.SelectedRow Retrieve cells of the selected row: –GridView1.SelectedRow.Cells[4] –It is a template with a Controls collection Convert the template to textbox: –TextBox t = (TextBox)(GridView1.SelectedRow.Cells[4].Controls[1]); Retrieve data entered in the textbox: – Response.Write(t.Text);

GridView’s SelectedIndexChanged Event Procedure Example protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) { string PID; PID=GridView1.SelectedRow.Cells[0].Text; TextBox qty = (TextBox)(GridView1.SelectedRow.Cells[4].Controls[1]); Response.Write(PID); Response.Write(qty.Text); }

Display Product Images with Product Information in a GridView

Images Folder and Save Image Path in the database 1. Add a folder and name it “Images” –Right click project name and select add/New Folder 2. Add images to the Images folder: –Right click Images folder/Add/Existing item/select images to add to the folder 3. In the product table, add a field to store the path to the image file.

A Product Table with Image Path Example: Path to the pic1.jpg file in the Images folder is: ~/Images/pic1.jpg

Create a GridView to Show Products with images, textbox and Add Button 1. Drag the Product table from the Data Connection to create the bound gridView. 2. Select Edit/Column by clicking the smart tag and delete the ProdPicPath field from the Selected Fields list. 3. Select Add New Column to add a new template 4. Select Edit Template and drag an Image control from the Toolbox to the template. 4. Click the Image control in the template and select Edit DataBindings. 5.Select Field Binding/Bound to/ProdPicPath