Just the Facts

 

  • ASP.NET comes with two grid controls DataGrid and GridView. The DataGrid works as it did in ASP.NET 1.x, whereas the GridView has a newer and more effective design and totally embraces the new data-binding model of ASP.NET 2.0.

  • The GridView supports more column types, including checkbox and image columns.

  • The GridView provides paging, sorting, and editing capabilities, and it relies on the bound data source control for effective implementation. If bound to an enumerable data source object (ASP.NET 1.x-style binding), it behaves like a DataGrid control.

  • If bound to a SqlDataSource control, the GridView heavily relies on the DataSet capabilities for paging and sorting data in memory.

  • If bound to an ObjectDataSource control, the GridView requires a fully fledged DAL that contains any custom logic for paging, sorting, and sometimes caching.

  • Compared to the DataGrid control, the GridView provides an extended eventing model: pre/post pairs of events, possibility of canceling ongoing operations, and more events.

  • To retrieve information about a clicked row, you use the CommandArgument property of the event data structure to get the index and you use the newest version of the DataKeys collection to access selected fields on the data item. With DataGrid, you can select only the primary key field and you need to run a query to access row data in drill-down scenarios.

 


Programming Microsoft ASP. Net 2.0 Core Reference
Programming Microsoft ASP.NET 2.0 Core Reference
ISBN: 0735621764
EAN: 2147483647
Year: 2004
Pages: 112
Authors: Dino Esposito

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