QA


Q&A

Q1:

The GridView and DetailsView look neat, but how can I customize the appearance further? I want to be able to have, say, three records displayed per table row rather than having one record per row as with the GridView.

A1:

The GridView and DetailsView both render their contents as an HTML <table> according to the rules discussed in this hour. So that means the GridView is always going to display exactly one record per table row, and the DetailsView is going to use a two-column <table> to display the columns of a particular database table record. Of course, both the GridView and DetailsView allow for a high degree of customization of the colors, fonts, borders, and so on.

If you need to customize the output more radically, you'll need to use one of the other data Web controls. The other three controlsthe DataList, the Repeater, and the FormViewuse templates. A template allows you to specify a mix of HTML markup and Web controls, thereby allowing a greater degree of customizability. As we'll see in the next hour, both the GridView and DetailsView do have some support for templates, but the support is only at the field-level. With the DataList, Repeater, or FormView, you can have row-level templates.

Q2:

The GridView seems to have a lot of functionality. Where can I learn more about the GridView control?

A2:

You're right, the GridView is a rather complex and feature-rich control, easily the most feature-heavy control in all of ASP.NET. In the next hour we'll examine many useful features of the GridView, including editing, deleting, paging, and sorting of the data. However, in this book we are only able to scratch the surface of the GridView. For more in-depth information on the GridView, check out "GridView Examples for ASP.NET 2.0" at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/GridViewEx.asp. It's an online article I authored with downloadable source code that includes more than 120 pages of GridView examples and lessons.




Sams Teach Yourself ASP. NET 2.0 in 24 Hours, Complete Starter Kit
Sams Teach Yourself ASP.NET 2.0 in 24 Hours, Complete Starter Kit
ISBN: 0672327384
EAN: 2147483647
Year: 2004
Pages: 233

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