ASP.NET Futures (2007): DynamicList Control
This section provides information about the following:
DynamicList control. This control is one of a set of dynamic data controls
that obtain schema information at run time, provide default display formats according
to common user expectations, and enable you to easily customize those formats.
The DynamicList control displays the rows of the current table using
a GridView control. You can provide user interface elements for filtering
the table by adding a DynamicFilter control.
<asp:DynamicList runat="server" />
This control has the following properties:
ControlID. Specifies the ID of a GridView control. The
DynamicList control uses the specified control to display the list
of rows instead of creating a GridView control with default settings.
This enables you to customize the appearance of the list.
EnableDelete. If true, the DynamicList control
enables users to delete rows and shows a Delete link. The
default is true.
EnableUpdate. If true, the DynamicList control
enables users to update rows and shows an Update link. The
default is true.
Customizing Control Behavior
To control what columns are displayed, and in what order, provide a GetColumns
method for the page. GetColumns takes no arguments and returns an
IEnumerable list of column names. For dynamic languages, this has the
effect of overriding the GetColumns method of the base class for the
page. For statically compiled languages, the GetColumns method must
explicitly override the base class method.
To customize each row before it displays, provide an InitRow method
for the page. InitRow takes one argument, the GridViewRow
object that is about to be displayed. It does not return a value. For dynamic languages,
this effectively overrides the InitRow method of the base class for
the page. For statically compiled languages, the InitRow method must
explicitly override the base class method.
See Also
Introduction: Dynamic Data Controls for ASP.NET
|