System.Web.UI.WebControls Namespace GridView Class
.NET Framework version 2.0
Returns or sets the text to render in an HTML caption element in a GridView control. This property is provided to make the control more accessible to users of assistive technology devices.
Inline |
<asp:gridview caption = strCaption ... > |
Script |
GridView.Caption [ = strCaption ] |
sCaption |
A string that represents the text to render in an HTML caption element in a GridView control. The default value is an empty string ( "" ). |
This property is read/write with no default value.
Use the Caption property to specify the text to render in an HTML caption element in a GridView control. The text that you specify provides assistive technology devices with a description of the table that can be used to make the control more accessible.
Additional accessibility support for the GridView control is provided by the CaptionAlign property. Use the CaptionAlign property to specify the alignment of the HTML caption element in a GridView control.
The value of this property, when set, can be saved automatically to a resource file by using a designer tool.
The following sample illustrates using the Caption property.
<asp:gridview id = "EmployeeGridView"
datasourceid = "EmployeeSource"
allowpaging
datakeynames = "EmployeeID"
caption = "Employee Details"
captionalign = "Left"
runat = "server">
GridView Members CaptionAlign