• Embed Doc
  • Readcast
  • Collections
  • CommentGo Back
Download
 
ASP.NET
 
2.0
 
DataList
 
Control
 
Page
 
|
 
1
 
ASP.NET
 
2.0
 
DataList
 
Control
 
Description ....................................................................................................................................................................2
 
Step
 
by
 
step
 
 –
 
Create
 
a
 
DataList
 
Control
 
to
 
display
 
data ..............................................................................................4
 
Step
 
by
 
step
 
 –
 
Create
 
a
 
DataList
 
Control
 
with
 
editing
 
enabled.....................................................................................9
 
Default
 
CommandName
 
Events ..............................................................................................................................11
 
Databinding
 
the
 
DataList
 
Control
 
to
 
a
 
Datasource......................................................................................................11
 
Postbacks.....................................................................................................................................................................12
 
DataList
 
Control
 
Events
 
&
 
Database
 
Operations.........................................................................................................13
 
Event
 
 –
 
EditCommand.............................................................................................................................................13
 
Event
 
 –
 
CancelCommand.........................................................................................................................................13
 
Event
 
 –
 
UpdateCommand........................................................................................................................................14
 
Event
 
 –
 
DeleteCommand.........................................................................................................................................14
 
Event
 
 –
 
ItemCommand............................................................................................................................................15
 
DataList
 
Control
 
Quick
 
Start........................................................................................................................................16
 
 
ASP.NET
 
2.0
 
DataList
 
Control
 
Page
 
|
 
2
 
Description
 
See
 
msdn.com
 
for
 
more
 
info:
 
http://msdn2.microsoft.com/en
us/library/system.web.ui.webcontrols.datalist.aspx
 
The
 
DataList
 
Control
 
belongs
 
to
 
the
 
System.Web.UI.WebControls
 
Namespace.
 
 
DataList
 
Control
 
Above:
 
Runtime
 
view
 
of 
 
the
 
rendered
 
DataList
 
Control.
 
This
 
DataList
 
Control
 
has
 
been
 
formatted
 
using
 
HTML
 
tables.
 
The DataList Control is a repeating control which displays displays the values of a DataSource using
templates
. Each template area allows for the addition of regular tools and may be formatted using html.The following table lists the supported templates.
Template Name Description
AlternatingItemTemplate
 
If defined, provides the content and layout for alternating items in theDataList. If not defined,
ItemTemplate
is used.
EditItemTemplate
If defined, provides the content and layout for the item currently being editedin the DataList. If not defined,
ItemTemplate
is used.
 
ASP.NET
 
2.0
 
DataList
 
Control
 
Page
 
|
 
3
 
FooterTemplate
If defined, provides the content and layout for the footer section of theDataList. If not defined, a footer section will not be displayed.
HeaderTemplate
If defined, provides the content and layout for the header section of theDataList. If not defined, a header section will not be displayed.
ItemTemplate
Required template that provides the content and layout for items in theDataList.
SelectedItemTemplate
If defined, provides the content and layout for the currently selected item inthe DataList. If not defined, ItemTemplate is used.
SeperatorTemplate
If defined, provides the content and layout for the separator between items inthe DataList. If not defined, a separator will not be displayed.At the very minimum, the ItemTemplate needs to be defined to display the items in the DataList control.The DataList control also allows you to select, sort, and edit records via DataList Control events.Locate the events belonging to the DataList Control by switching to Code view and then selecting the nameof your DataList Control from the
Class Name
drop down list (left). Then click the arrow on the
MethodName
drop down list (right).
DataList Control events
Above:
 
DataList
 
Control
 
events
 
Method
 
Name
 
list.
 
of 00

Leave a Comment

You must be to leave a comment.
Submit
Characters: ...
You must be to leave a comment.
Submit
Characters: ...