Accessibility and the Datagrid

G

Guest

Hi folks,
I'm using ASP.net 1.1 with C#

I've been instructed by my employers that I must comply with the UK DDA
(Disability Discrimination Act 1995).

My app is largely compliant only semantic markup and plenty of CSS, but even
though my datagrid has UseAccessiblityHeaders set to true this is not enough
that property only adds scope="col" and <th> elements

I need to access the header elements and add
id=""
Then I need to access each <td> and add a headers="" to follow the name of
that column's Id attribute

I'm doing this in the ItemCreated event of the datagrid like so..

switch (e.Item.ItemType)
{
case ListItemType.Header:
for(int i=0;i<e.Item.Controls.Count;i++)
{
tc=(TableCell) e.Item.Controls;
tc.ID="H"+(i+1);
}
break;
case ListItemType.Item:

etc....

my problem
the ID of H+ integer is giving me a weirder and longer name made up by the
control itself

dgPortfolio__ctl1_H1
dgPortfolio__ctl1_H2

etc...

second how can I add the headers= attribute into the body of the table (i.e
the other cells) to get each one in turn to reflect that it belongs to that
column

I thought I could use InnerHtml, but how do I do that to a cell at runtime...

or perhaps you have a better idea altogether how to make my datagrid
compliant with accessibility standards

Regards, and thanks in advance
CharlesA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,234
Latest member
SkyeWeems

Latest Threads

Top