<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>shepherdweb.com &#187; (x)html</title>
	<atom:link href="http://shepherdweb.com/category/web-code/xhtml/feed/" rel="self" type="application/rss+xml" />
	<link>http://shepherdweb.com</link>
	<description>Shane Shepherd: web design and development; music</description>
	<lastBuildDate>Wed, 11 Nov 2009 01:46:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>ASP.NET DataGrid Caption Element</title>
		<link>http://shepherdweb.com/2005/10/22/aspnet-datagrid-caption-element/</link>
		<comments>http://shepherdweb.com/2005/10/22/aspnet-datagrid-caption-element/#comments</comments>
		<pubDate>Sun, 23 Oct 2005 02:32:06 +0000</pubDate>
		<dc:creator>Shane</dc:creator>
				<category><![CDATA[(x)html]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Microsoft]]></category>

		<guid isPermaLink="false">http://www.shepherdweb.com/?p=17</guid>
		<description><![CDATA[ASP.NET 1.1 can generate accessible tables through DataGrid server control.  This is not breaking news, but I want to put this out there because I had so much difficulty finding it.  MS released a hotfix which made it possible to comply with Section 508.  The new DataGrid properties are UseAccessibleHeader, Caption, and [...]]]></description>
			<content:encoded><![CDATA[<p>ASP.NET 1.1 can generate accessible tables through DataGrid server control.  This is not breaking news, but I want to put this out there because I had so much difficulty finding it.  <acronym title="Microsoft">MS</acronym> released a <a href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;823030">hotfix</a> which made it possible to comply with <a href="http://www.access-board.gov/508.htm">Section 508</a>.  The new DataGrid properties are <b>UseAccessibleHeader</b>, <b>Caption</b>, and <b>CaptionAlign</b>. <b>UseAccessibleHeader</b> is a boolean property that is set to false by default.  When set to true the DataGrid renders the table headers inside the &lt;th&gt; element with a scope=&#8221;col&#8221; element.  The subsequent versions of ASP.NET 1.1 have this fix rolled in already.</p>
<p>Ok, so how about an example?  You came to the right place&#8230;read on!</p>
<p>In your .aspx page:<br />
<code class="block"><br />
&lt;asp:datagrid runat="server" id="mydatagrid" useaccessibleheader="true" caption="My DataGrid"&gt;<br />
  &lt;columns&gt;<br />
    &lt;asp:templatecolumn headertext="Column 1"&gt;<br />
      &lt;itemtemplate&gt;<br />
        &lt;%# DataBinder.Eval(Container.DataItem, "myData1")%&gt;<br />
      &lt;/itemtemplate&gt;<br />
    &lt;/asp:templatecolumn&gt;<br />
    &lt;asp:templatecolumn headertext="Column 2"&gt;<br />
      &lt;itemtemplate&gt;<br />
        &lt;%# DataBinder.Eval(Container.DataItem, "myData2")%&gt;<br />
      &lt;/itemtemplate&gt;<br />
    &lt;/asp:templatecolumn&gt;<br />
  &lt;/columns&gt;<br />
&lt;/asp:datagrid&gt;<br />
</code><br />
Renders:<br />
<code class="block"><br />
&lt;table&gt;<br />
   &lt;caption&gt;MyDataGrid&lt;/caption&gt;<br />
   &lt;tr&gt;<br />
      &lt;th scope="col"&gt;Column 1&lt;/th&gt;<br />
      &lt;th scope="col"&gt;Column 2&lt;/th&gt;<br />
   &lt;/tr&gt;<br />
   &lt;tr&gt;<br />
      &lt;td&gt;&lt;!--My Data 1...etc...--&gt;&lt;/td&gt;<br />
      &lt;td&gt;&lt;!--My Data 2...etc...-&gt;&lt;/td&gt;<br />
   &lt;/tr&gt;<br />
&lt;/table&gt;<br />
</code><br />
I hope this saves someone else all the searching I had to do.  As usual, I welcome your feedback.</p>
]]></content:encoded>
			<wfw:commentRss>http://shepherdweb.com/2005/10/22/aspnet-datagrid-caption-element/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
