JavaScript Editor JavaScript Editor     JavaScript Debugger

Previous Section Next Section

Main Page

Using the DataList Class

A data-bound list control displays items using templates. Data lists are supported with the DataList class; here is the inheritance hierarchy of that class:

Object
   Control
      WebControl
         BaseDataList
            DataList

You can find the notable public properties of DataList objects in Table 23.6 and their notable events in Table 23.7. (This class has no non-inherited methods.) Note that as with other Web server controls, I am not listing the notable properties, methods, and events this class inherits from the Control and WebControl classes—you can find them in Tables 15.1 to 15.5 in Chapter 15.

Table 23.6: Noteworthy public properties of DataList objects.

Property

Means

AlternatingItemStyle

Gets the style for alternating items.

AlternatingItemTemplate

Gets/sets the template for alternating items.

EditItemIndex

Gets/sets the index number of the selected item to edit.

EditItemStyle

Gets the style for the item selected for editing.

EditItemTemplate

Gets/sets the template for the item selected for editing.

FooterStyle

Gets the style for the footer.

FooterTemplate

Gets/sets the template for the footer.

GridLines

Gets/sets the grid line style.

HeaderStyle

Gets the style of the header.

HeaderTemplate

Gets/sets the template for the header.

Items

Gets the items in the list.

ItemStyle

Gets the style for the items in the list.

ItemTemplate

Gets/sets the template for items.

RepeatColumns

Gets/sets the number of columns to display.

RepeatDirection

Gets/sets if data is displayed horizontally or vertically.

RepeatLayout

Gets/sets if the control is displayed as a table or with a flow layout.

SelectedIndex

Gets/sets the selected item's index.

SelectedItem

Gets the selected item.

SelectedItemStyle

Gets the style properties for selected items.

SelectedItemTemplate

Gets/sets the template for selected items.

SeparatorStyle

Gets the style of separators.

SeparatorTemplate

Gets/sets the template for separators.

ShowFooter

Gets/sets if the footer is displayed.

ShowHeader

Gets/sets if the header is displayed.

Table 23.7: Noteworthy public events of DataList objects.

Event

Means

CancelCommand

Occurs when Cancel is clicked.

DeleteCommand

Occurs when Delete is clicked.

EditCommand

Occurs when Edit is clicked.

ItemCommand

Occurs when any button is clicked.

ItemCreated

Occurs when an item is created.

ItemDataBound

Occurs when an item is data bound to a data list.

UpdateCommand

Occurs when Update is clicked.

Previous Section Next Section




JavaScript Editor Free JavaScript Editor     JavaScript Editor