
DataList | 847
WebControls
Namespace
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
Associated Events
DataGrid.SortCommand( )
DataKeyCollection
System.Web.UI.WebControls (system.web.dll)
sealed class
The DataKeyCollection class contains a read-only collection of primary field key names as
strings. This class is used by the BaseDataList.DataKeys property to facillitate editing (for
example, you can use a unique ID for your key field and use it to build SQL state-
ments when you need to update a record in response to a user edit operation). You
must specify the data key you want to use in the BaseDataList.DataKeyField property before
you bind the data list.
Returned By
BaseDataList.DataKeys
DataList
System.Web.UI.WebControls (system.web.dll)
disposable
class
The DataList control is a data-bound list that is configured through templates in the .aspx
file. It does not provide quite the extent of features found in the DataGrid control. It does
provide support for automatic selection (by setting the SelectedIndex property) and editing
(by setting the EditItemIndex property), but not for automatic paging or sorting. Also, there
is no support for default column types or automatically generated rows, so you will
always need to specify at least an ItemTemplate. Templates for the DataList are bracketed
inside the appropriate template tag (like <ItemTemplate> ...