DREAMWEAVER CS3
User Guide
692
Before using the DataGrid server behavior, you must define a DataSet (referred to as a recordset by other document
types) for the DataGrid.
To learn more about the DataGrid control, and how it can be used to format dynamic data, see the Microsoft website
at
http://msdn.microsoft.com/library/en-us/cpgenref/html/cpcondatagridwebservercontrol.asp
.
See also
“About recordsets” on page 543
Add an ASP.NET DataGrid control to a page
DataGrid controls let you format and display dynamic data in multi-column grids that are rendered as tables.
Note:
Before inserting the DataGrid server behavior, you must define a DataSet (referred to as a recordset by other
document types) for the DataGrid.
1
Open the Server Behaviors panel (Window > Server Behaviors), click the Plus (+) button, and select DataGrid.
2
Select the ID attribute (or label) of the DataGrid control.
This field is pre-populated with a value. You can change the value of the DataGrid; however, if you set the value of
the field to that of an existing ID, you must enter a new attribute value.
3
Select a DataSet to associate with the DataGrid.
This is the DataSet from which the DataGrid retrieves information. Dreamweaver fills the Grid Columns box with
bound columns for all of the fields in the selected DataSet.
4
Specify the number of records to be displayed.
5
Select the type of page navigation links to implement.
•
The Links To Previous And Next Pages item adds Next and Prev links.
•
The “Numbered Links To Every Page” item adds page-number links— for example, “1 2 3 4 5
n
...”.
6
Remove the grid columns you don’t want by selecting them in the Grid Columns box, and clicking the Minus (-)
button.
7
You can edit the remaining grid columns by selecting a column in the Grid Columns box and setting its properties.
Hyperlink
The Hyperlink column displays information as hypertext links. A typical use
is to display data (such as a customer number or product name) as a hyper-
link that users can click to navigate to a separate page that provides details
about that item.
Edit, Update, Cancel Buttons
Referred to as the “edit command” column in ASP.NET, the Edit, Update,
Cancel Buttons column lets users perform in-place editing of information
in DataGrid rows. To do so, create an Edit, Update, Cancel Buttons column.
At run time, this column displays a button labeled Edit. When the user
clicks the Edit button, the row data is displayed in editable controls such as
text boxes, and the Edit button is replaced with Update and Cancel
buttons.
Delete Button
The Delete Button lets a user delete a particular row by clicking a button.
DataGrid Column Type
Description
September 4, 2007