Use the BoundColumn class to display the contents of a field in the data source.
<asp:DataGrid id="accessID" runat="server"
AutoGenerateColumns=false
...
<Columns>
<asp:BoundColumn
DataField = "DataSourceField"
DataFormatString = "FormatString"
ReadOnly = "true | false" />
....
</Columns>
</asp:DataGrid>
| Property |
Description |
| DataField |
The field name from the data source to bind to the BoundColumn. |
| DataFormatString |
The string that specifies the display format for items in the BoundColumn. |
| ReadOnly |
true if the the items in the BoundColumn can be edited, false otherwise. |
For an example of using a BoundColumn control, see Adding Bound Columns to a DataGrid Web Server Control.
For additonal information, see the BoundColumn Class documentation.