Tackle Complex Data Binding in WinForms 2.0

Similar documents
Data Binding with Windows Forms 2.0

Build Custom Data Bound Objects and Collections

Data Binding in ASP.NET 2.0

Smart Client Offline Data Caching and Synchronization

NET237: Deploying Smart Client Apps with ClickOnce

Drive Application Behavior with Application and User Configuration Settings Brian Noyes IDesign Inc (

APP301: Implement a Data Access Layer with Enterprise Library

Drive Application Behavior with Application and User Configuration Settings. Brian Noyes IDesign Inc (

Building Extensible XAML Client Apps

Introduction to.net Deployment. Brian Noyes IDesign, Inc. (

Thinking and Processing in Parallel Wrap Your Head Around WF 4.0 Concurrency. Brian Noyes IDesign Inc (

VSC01 Securing WPF Client Applications

NE.15 Data Binding In Windows Presentation Foundation

Windows Presentation Foundation In Windows Forms And Vice Versa

AR.04 Composite Application Guidance for WPF (aka Prism ) Brian Noyes IDesign Inc (

Composite Application Guidance for WPF and Silverlight (AKA Prism 2 )

Prism Composite Application Guidance

Build Loosely Coupled Silverlight Business Applications

LVL08 Black Belt Silverlight Business Data Validation

Building Extensible XAML Client Apps

Programming with ADO.NET

VS10 WCF of Many Flavors When do I use which?

Build Process Driven Applications with WF

VWC02 Build N-Tier Silverlight Data Applications Easily with WCF RIA Services

Microsoft TechEd US, Europe, Malaysia, Visual Studio Connections, DevTeach, INETA Speakers Bureau, MSDN Webcasts

Build Testable Client and Service Applications

VS08 This One Goes to Going Parallel with PFX, PLINQ, TPL and Async Keywords

WCF RIA Services. About Brian 8/10/2011. Brian Noyes Chief Architect IDesign Inc. (

Blissful Separation of Concerns with Model-View-ViewModel (MVVM)

Learn to Behave Extend Your XAML with Behaviors

Building Loosely Coupled XAML Client Apps with Prism

Extending ASP.NET. Brian Noyes Principal Software Architect IDesign, Inc. ( (

VS2010 C# Programming - DB intro 1

Chapter 3. Windows Database Applications The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill

Smart Client Offline Data Caching and Synchronization

C# Programming: From Problem Analysis to Program Design 2nd Edition. David McDonald, Ph.D. Director of Emerging Technologies. Objectives (1 of 2)

Introduction to using Visual Studio 2010 to build data-aware applications

Windows Database Applications

Data Binding. Data Binding

Getting Started with ComponentOne LiveLinq

How to use data sources with databases (part 1)

ADO.NET 2.0. database programming with

Introduction. Introduction. Copyright by LearnNow, LLC All rights reserved. Reproduction is strictly prohibited.

CSC 330 Object-Oriented

Building Datacentric Applications

Introduction. Introduction. JavaScript 1.8: Web and Objects Copyright by LearnNow, LLC All rights reserved. Reproduction is strictly prohibited.

Program Contents: DOTNET TRAINING IN CHENNAI

Index. AutoNumber data types, 154 6, 168 and Number data type, 181 AutoPostBack Property, 505, 511, 513 5, 527 8, AVG, 242, 247 8

Microsoft Visual C# 2005: Developing Applications Table of Contents

About the Authors Introduction p. 1 Exploring Application Architectures p. 9 Introduction p. 9 Choosing the "Right" Architecture p.

Mobile MOUSe ASP.NET FOR DEVELOPERS PART 1 ONLINE COURSE OUTLINE

Chapter 10. Database Applications The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill

Contents. Using Interpreters... 5 Using Compilers... 5 Program Development Life Cycle... 6

TABLE OF CONTENTS. Data binding Datagrid 10 ComboBox 10 DropdownList 10. Special functions LoadFromSql* 11 FromXml/ToXml 12

TABLE OF CONTENTS. Data binding Datagrid 10 ComboBox 10 DropdownList 10

Form Designer User Guide DOC-FD-UG-US-01/11/13

Supporting Non-Standard Development Configurations

Introduction. Introduction

DEVELOPING WINDOWS APPLICATIONS WITH MICROSOFT VISUAL STUDIO 2010

Advanced Programming C# Lecture 5. dr inż. Małgorzata Janik

PDSA. Developer's Guide to Reporting Services 2008 R2. design» architecture» security» training» best practices:pdsa.com

Introduction. Introduction

Microsoft ASP.NET Whole Course Syllabus upto Developer Module (Including all three module Primary.NET + Advance Course Techniques+ Developer Tricks)

Application Aspect. Hierarchical DataGridView v1.7 BOOKLET

EFFECTIVE C# (COVERS C# 6.0), (INCLUDES CONTENT UPDATE PROGRAM): 50 SPECIFIC WAYS TO IMPROVE YOUR C# (3RD EDITION) (EFFECTIVE SOFTWARE DEV

Developing Windows Applications with Microsoft Visual Studio 2010

WinForms Charts How to Invoke the Chart Wizard at Runtime

DataGridView FAQ.doc. DataGridView FAQ.doc

Tasks. actions and generate results. Encapsulate a workflow. UI for gathering input. Generate results

B.E /B.TECH DEGREE EXAMINATIONS,

DE Developing Windows Applications with Microsoft Visual Studio 2010

ComponentOne Data Source for Entity Framework 1

Visual.NET Extensions Tutorial

Simple sets of data can be expressed in a simple table, much like a

An Introduction to Application Development in. Microsoft Visual Studio.NET

WinForms Charts How to Determine the Chart Element underneath. the Mouse Cursor and Display Series Point s Data in a Tooltip

Volume CREATIVE DATA TECHNOLOGIES, INC. DATALAYER.NET. Getting Started Guide

In this chapter, I m going to show you how to create a working

ASP.NET 2.0 p. 1.NET Framework 2.0 p. 2 ASP.NET 2.0 p. 4 New Features p. 5 Special Folders Make Integration Easier p. 5 Security p.

CIM University: Using Enterprise Architect Schema Composer

Copy Datatable Schema To Another Datatable Vb.net

Working with Data in ASP.NET 2.0 :: Querying Data with the SqlDataSource Control Introduction

The Processing Directives of a Page p. 91 The Page Class p. 99 Properties of the Page Class p. 100 Methods of the Page Class p.

Beginning Silverlight 5 in C #

ArtOfTest Inc. Automation Design Canvas 2.0 Beta Quick-Start Guide

6 Months Training Module in.net Module 1-Total Days-20

Office as a development platform with Visual Studio Daniel Moth Developer and Platform Group Microsoft

You can use Dreamweaver to build master and detail Web pages, which

Working with Data in ASP.NET 2.0 :: Using Parameterized Queries with the SqlDataSource Introduction

By Susan L. Miertschin

Toolkit Activity Installation and Registration

Xiaoying Guo Program Manager Microsoft Server and Tools China Session Code: DEV377

PREPARATION. Install MyGeneration and add the doodads project to your solution

Chapter 4. Windows Database Using Related Tables The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill

C# Syllabus. MS.NET Framework Introduction

Visual Studio.NET Add-in. Includes Bonus ADO.NET IN A NUTSHELL. A Desktop Quick Reference. Bill Hamilton & Matthew MacDonald

Windows Database Updates

1 Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Siebel Web Services RAD Development Futures

INTRODUCTION TO VISUAL BASIC 2010

Transcription:

Tackle Complex Data Binding in WinForms 2.0 Brian Noyes Principal Software Architect IDesign,, Inc. (www.idesign.net( www.idesign.net) About Brian Microsoft MVP in ASP.NET Writing MSDN Magazine, CoDe Magazine, The Server Side.NET, asp.netpro,, Visual Studio Magazine Data Binding in Windows Forms 2.0, Addison-Wesley, expected release fall 2005 Speaking Microsoft TechEd US, Europe, Malaysia, Visual Studio Connections, DevTeach, DevEssentials, VSLive!, INETA Speakers Bureau Participate in Microsoft design reviews E-mail: brian.noyes@idesign.net Blog: http://www.softinsight.com/bnoyes 1

Agenda Quick Intro to Data Binding Intro to Data Window Generating Bound UI Controls from Data Binding Existing Controls to Data Customizing Bound Control Types Data Binding Intro One-way: Automatically populating controls with data Set a few properties No need to iterate yourself Two-way: way: Automatically propagating changes to data From control to data source (client side) No need to iterate and check for changes 2

Data Binding.NET support Core capability of.net controls since.net 1.0 Web and Windows Built in at base Control level Derived controls can specialize for specific scenarios Ex: DataGrid supports advanced DataSet features Interface-based Data Binding Simple and Complex Simple Data Binding Bind a single value from a data collection to a single control property Ex: CustomerName field to Text property on TextBox Complex Data Binding Bind collection of data to control that presents multiple values from collection Ex: Customers table in grid, CustomerName values in ComboBox 3

Data Binding Control Properties Simple Data Binding Create a Binding object Ties control property to data source and data member Add to DataBindings collection of control Complex Data Binding Set data source Set data member (optional) DisplayMember and ValueMember for ComboBox and ListBox controls Data Binding Control Data Direct DataSet (Typed DataSet) ) / DataTable / DataView Object collections Objects Indirect (preferred) BindingSource (new in.net 2.0) 4

Agenda Quick Intro to Data Binding Intro to Data Window Generating Bound UI Controls from Data Binding Existing Controls to Data Customizing Bound Control Types Data Window Overview New in Visual Studio 2005 Primary point of control for establishing data binding Bring data sources into the project Add controls to forms Associate data sources with controls 5

Data Window Database Launches Data Source Configuration Wizard Adds Typed Data Set definition to project Local SQL Express database Web Service Interprets return type of Web service methods Object Uses public properties and fields Data Window Handles hierarchical objects Child object reference (1 : 1) Child collections (1 : Many) Presents as tree Drill down to desired collection / property 6

Agenda Quick Intro to Data Binding Intro to Data Window Generating Bound UI Controls from Data Binding Existing Controls to Data Customizing Bound Control Types Databases Add New Data Source Data menu or Data Window Data Source Configuration Wizard Pick connection Pick database objects Generates typed data set definition 7

Web Service Existing Web Reference types included automatically in Data Add New Data Source Web Service option Launches Add Web Reference Wizard Extracts return types from Web methods Creates Web reference in project Exposes Web method return types as objects for data binding Object Point to assembly containing type definition Select type from assembly Exposes public properties for data binding 8

Demonstration #1# Agenda Quick Intro to Data Binding Intro to Data Window Generating Bound UI Controls from Data Binding Existing Controls to Data Customizing Bound Control Types 9

Generating Bound Controls Overview Each data source and member has UI controls associated with it Defaults set automatically based on type and location Drag and drop onto form generates bound controls Generating Bound Controls Default Control Types Collections: DataGridView Details (Collection of controls per field/property) Custom Properties or fields: TextBox Label LinkLabel ComboBox ListBox Custom 10

Demonstration #2 Generating Bound Controls Agenda Quick Intro to Data Binding Intro to Data Window Generating Bound UI Controls from Data Binding Existing Controls to Data Customizing Bound Control Types 11

Binding Existing Controls Overview Data sources can also be used with existing controls on a form Drag data source item onto control Designer sets appropriate data binding properties based on the source Creates needed members Binding,, table adapters, data sets, navigators Demonstration #3 Binding to Existing Controls 12

Agenda Quick Intro to Data Binding Intro to Data Window Generating Bound UI Controls from Data Binding Existing Controls to Data Customizing Bound Control Types Custom Bound Controls Overview Can create custom controls for use in Data binding Presented controls based on Windows Forms Designer options settings Select control types per data type Based on controls currently in the Toolbox Can include your custom controls 13

Custom Bound Controls Creating controls Requires binding attributes DefaultBindingProperties Single value control LookupBindingProperties List control ComplexBindingProperties - Grid Additional Resources Windows Forms Object Data Binding in.net 2.0, 15 Seconds.com,, Rocky Lhotka http://www.15seconds.com/issue/040614.htm Drag Once Data Binding, Steve Lasker, CoDe Magazine, Sep/Oct 2004 http://www.code-magazine.com/article.aspx?quickid=0409051 Drag Once Data Binding with Custom Controls, Steve Lasker, CoDe Magazine, Nov/Dec 2004 http://www.code-magazine.com/article.aspx?quickid=0411071 Tackle Complex Data Binding in Windows Forms 2.0, Brian Noyes, CoDe Magazine, May/June 2005 E-mail: brian.noyes@idesign.net Blog: http://www.softinsight.com/bnoyes 14