DataGrid Controls and Data Persistence

Chapter 3

Templated DataGrid Controls

As you learned in the first two chapters, the DataGrid control has a table-based structure and is flexible enough to let you determine the structure and contents of columns. Specifically in Chapter 2, you saw DataGrid controls in action and learned how to use their basic yet powerful characteristics. You also learned how to bind special columns representing actions and links. In this chapter, I ll show you how to use HTML templates to take item customization to the next level. You ll learn how to design the content of a column so that it closely reflects the meaning and the structure of your data.

Templated columns enable you to use a combination of HTML and server controls to design a custom layout for a column. The controls in a templated column can be bound to any combination of fields in the data source. You can group multiple fields in a single expression and even embellish fields with HTML attributes such as bold or italic. Templates are column-specific and cannot be applied to auto-generated columns. If you want more than one column to share the same template, you can either duplicate the code in the ASP.NET page for each column, or save some code by loading the template from an external file.



Building Web Solutions with ASP. NET and ADO. NET
Building Web Solutions with ASP.Net and ADO.NET
ISBN: 0735615780
EAN: 2147483647
Year: 2002
Pages: 75
Authors: Dino Esposito

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