PRB: DataColumn.Caption Property Does Not Set Column Headers of DataGrid Web Server Control as Expected (316261)
The information in this article applies to:
- Microsoft ASP.NET (included with the .NET Framework) 1.0
- Microsoft ASP.NET (included with the .NET Framework 1.1)
This article was previously published under Q316261 SYMPTOMS If you use the DataColumn.Caption property to set the display text for column headers of a DataGrid Web server control, the column headers may not be set to the text
that you specify. CAUSE Columns are abstracted as properties of a DataRow object. By design, the properties are named according to the
value of the ColumnName property, not the value of the Caption property so that you can bind to arbitrary objects and not just
to DataRow objects. RESOLUTION To set the header text for columns so that the text differs
from the value of the ColumnName, set the AutoGenerateColumns property to false. Additionally, you must explicitly declare the column and specify
the header text for the column. REFERENCESFor additional information about the ASP.NET roadmap, click
the article number below to view the article in the Microsoft Knowledge Base: For more information about data binding and how to
work with the DataGrid Web server control, see the following ASP.NET QuickStart
tutorial: For general information about ASP.NET, see the following MSDN
newsgroup:
Modification Type: | Major | Last Reviewed: | 9/20/2006 |
---|
Keywords: | kbDataBinding kbprb kbServerControls kbWebForms KB316261 |
---|
|