| |||||
DataGrid.AutoGenerateColumns PropertySystem.Web.UI.WebControls Namespace DataGrid Class Sets or retrieves a value specifying whether BoundColumn objects are automatically created and displayed in the DataGrid control for each field in the data source. Syntax
Property ValueThis property accepts or returns only a boolean value: true if BoundColumn objects are automatically created and displayed; otherwise, false. Default value is true. RemarksUse this property to automatically create a BoundColumn object for each field in the data source. Each field is then rendered as a column in the DataGrid control in the order that the fields appear in the data source.
ExampleThe following example demonstrates how to disable the AutoGenerateColumns property to enable using other column types for each specified field in the data source. <asp:datagrid id = "myGrid" runat = "server" ...
autogeneratecolumns=false>
<columns>
<asp:boundcolumn headertext = "Brand"
datafield = "Brand" />
...
<asp:templatecolumn>
...
</asp:templatecolumn>
</columns>
</asp:datagrid>
See AlsoDataGrid Members BoundColumn ButtonColumn EditCommandColumn HyperLinkColumn TemplateColumn |
| ||||
Check out related books at Amazon
© 2000-2008 Rey Nuñez All rights reserved.
If you have any question, comment or suggestion
about this site, please send us a note
You can help support aspxtreme