Part IV: Miscellaneous Data Control Topics

In Part IV, we will turn our attention to two topics. First, in Chapter 11, "Altering the Data Before It's Rendered," we'll look at using the ItemCreated and ItemDataBound events of the DataGrid, DataList, and Repeater controls. When a data Web control's DataBind() method is called, an item is added to the data Web control for each record in the specified DataSource. These two events fire for each row added to the data Web control. By providing event handlers for these events, we can determine the value of the data being bound to the data Web control, and alter the properties of the data Web control based on the value of the data. This has many real-world applications, such as having a DataList where items that meet a certain criteria are displayed differently. For example, imagine that you are displaying a list of stocks and their prices in a DataList. You might want to use a red-colored, bold font for those stocks whose price has changed more than 5% during the day's trading.

In Parts I, II, and III, we saw code that used the built-in DataGrid column controls, which include the BoundColumn, the TemplateColumn, the ButtonColumn, and so on. In Chapter 12, "Creating Custom Column Controls for the DataGrid," we will look at how to create our own column controls for the DataGrid. Commonly, the programming logic performed by a DataGrid custom column control can accomplished by providing code in the ASP.NET server-side code. However, by packaging the programming logic into a control, we can encapsulate the programming complexity, making our ASP.NET Web pages and server-side code more readable, reliable, and maintainable.

The two chapters in Part IV conclude this book. I hope you have enjoyed reading this book as much as I enjoyed writing it. If you have any comments or suggestions, I welcome your email at mitchell@4guysfromrolla.com. Also, for more information on the data Web controls and ASP.NET, I invite you to read the hundreds of articles found on the Web site on which I serve as editor: http://www.4GuysFromRolla.com.

Thanks for reading, and Happy Programming!



ASP. NET Data Web Controls Kick Start
ASP.NET Data Web Controls Kick Start
ISBN: 0672325012
EAN: 2147483647
Year: 2002
Pages: 111

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