Chapter 18 Designing Data-Driven Windows Applications

Team Fly 

Page 505

Chapter 18
Designing Data-Driven Windows Applications

IN CHAPTER 15 WE discussed the architecture of ADO.NET and the classes that make up ADO.NET. So far we've shown you simple examples to demonstrate the basic operations you can perform with the ADO.NET objects, and the interfaces of these sample applications were based on the DataGrid control. The DataGrid control is not the be-all-and-end-all of your data display requirements. For one thing, it's almost impossible to edit a DataGrid control without reaching for the mouse, and a basic requirement for many applications is that they be used with the keyboard only. Another limitation of the DataGrid control is that it doesn't support the functionality of the ComboBox control, which is frequently used as a lookup tool. If you search the Internet for tips on using Windows controls, you'll find numerous resources on adding functionality to the DataGrid control. Our tip is to not use a control for a purpose for which it wasn't designed.

Real-world applications are based on interfaces built with regular Windows controls—data-binding is not a developer's first choice. In this section you'll learn how to build functional, userfriendly applications with regular Windows controls. You'll also learn how to build navigational tools that allow users to quickly locate the desired rows. A navigational tool based on a couple of buttons that take the user to the next or previous row is simply unacceptable. In this chapter we'll describe a couple of functional navigational models that you can use with your applications.

We'll start this chapter with a quick overview of data-binding and then we'll present a few typical data-driven applications. The applications of this chapter contain quite a bit of code, but these aren't simple applications. We'll explain their architecture and then we'll look at the code. We suggest that you download the projects from the book's website and open them in the Visual Studio IDE. The projects are well documented and you'll find it easy to understand their code.

Data-Binding

Data-binding is a mechanism for mapping selected columns of a DataTable to a control property, which is usually the Text property. When a control is bound to a column, the column's value is displayed automatically on the control. As you move through the rows of the DataTable, the property changes value to reflect the value of the bound column in the current row. If the control's text is

Team Fly 


Visual Basic  .NET Power Tools
Visual Basic .NET Power Tools
ISBN: 0782142427
EAN: 2147483647
Year: 2003
Pages: 178

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net