By: John Kilgo Date: January 23, 2003 Download The Code.
Printer Friendly Version
The DataList is not as powerful as the DataGrid. It requires more work from you since it has no default data presentation format. However, the DataGrid begins to get very cumbersome as the number of columns of data you present increases. Anything more than half a dozen columns or so and you probably induce horizontal scrolling -. a real no-no for me If you put such a DataGrid into edit mode then you really have a horizontal scrolling problem The DataList, with its ItemTemplate and EditItemTemplate, make it very easy. for you to control the appearance (and screen real estate) of the data. As I said before, it requires more coding but the results may well be worth the effort. In this article and example program we will deal with the Northwind Customers table. I have included nine columns of editable data. I have divided the work between an aspx page and a code-behind page. in the aspx page we layout our presentation of data, while the code-behind file places the DataList in edit mode, a nd handles the updating of modified data. The aspx file will be shown below in several sections to make it easier to explain what each section does. This first section is the usual top-of-page "stuff" and the definition of the DataList Control ....................................
<% @ Page language = "vb" src = "DATALISTEDIT.ASPX.VB" inherits = "main"%>