DREAMWEAVER CS3
User Guide
695
•
In Design view, select the control and use the Property inspector to change any of the options.
•
Double-click the object in the Server Behaviors panel and change its properties in the dialog box that opens.
•
In Code view, select the DataGrid or DataList on the page, and use its tag dialog box to change its attributes.
Specify and format a data source field in a DataGrid
When creating or editing a DataGrid, use the Simple Data Field column (called a bound column in ASP.NET) to
specify which data source field to display, and the data format the field uses with a .NET formatting expression.
1
In the DataGrid dialog box, select the Simple Data Field column in the Columns box.
2
In the Simple Data Field dialog box, enter a title for the grid’s header or footer rows. (Displaying a header or footer
row for a DataGrid is controlled by the DataGrid Property inspector.)
3
Select a DataSet column with which to populate the DataGrid column from the Data Field pop-up menu.
4
Select the Read Only option to specify that the DataGrid does not allow add, update, or delete privileges.
5
From the Submit As pop-up menu, select a data type, and click OK.
See also
“Add an ASP.NET DataGrid control to a page” on page 692
“Modify an ASP.NET DataGrid or DataList control” on page 694
Design a custom layout for a free-form DataGrid column
When creating or editing a DataGrid, use the Free Form option (called a template column in ASP.NET) to create
combinations of HTML text and server controls to design a custom layout for a column. The controls within a free-
form column can be data-bound. Free-form columns give you great flexibility in defining the layout and function-
ality of the grid contents, because you have complete control over how the data is displayed and what happens when
users interact with rows in the grid.
1
In the DataGrid dialog box, select the Free Form column in the Columns box.
2
In the Free Form dialog box, enter a title for the grid’s header or footer rows. (Displaying a header or footer row
for a DataGrid is controlled by the DataGrid Property inspector.)
3
Select a template to use with the Free Form DataGrid from the Template pop-up menu.
4
Click the Add Data Field button, select a DataSet column to populate the grid column, and click OK.
An appropriate data-binding expression is displayed in the Contents box.
5
Format the Free Form column by enclosing the binding expression with HTML tags in the Contents box.
6
From the Submit As pop-up menu, select a data type, and click OK.
See also
“Add an ASP.NET DataGrid control to a page” on page 692
“Modify an ASP.NET DataGrid or DataList control” on page 694
September 4, 2007