This is a migrated thread and some comments may be shown as answers.

Section 508 & WCAG pattern for Header - ID pattern for tables

1 Answer 19 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ken Lassesen
Top achievements
Rank 2
Ken Lassesen asked on 19 Feb 2010, 05:46 PM

Requirements

RadControls version

2009.3.1314    

.NET version

ALL

Visual Studio version

ALL

programming language

C#

browser support

all browsers supported by RadControls


PROJECT DESCRIPTION
The following event handler will add headers and ids to the output of a radGrid. For Section 508 accessibility there are several methods (because accessibility browsers do different implementation). This implements one of these methods. It may co-exist with the scope pattern to cover more accessibility browsers.
static void grid_ItemCreatedAddIdHeader(object sender, GridItemEventArgs e)     
{     
    var colno = 1;     
    if (e.Item is GridHeaderItem)     
    {     
        colno = 1;     
        GridHeaderItem headItem = e.Item as GridHeaderItem;     
        foreach (GridColumn col in headItem.OwnerTableView.Columns)     
        {     
            TableCell cell = headItem[col.UniqueName];     
            cell.Attributes["id"] = string.Format(CultureInfo.CurrentCulture, "header{0}", colno); ;     
            colno++;     
        }     
    }     
    if (e.Item is GridDataItem)     
    {     
        // Add headers alternative to grid     
        colno = 1;     
        foreach (GridColumn col in dataItem.OwnerTableView.Columns)     
        {     
            TableCell cell = dataItem[col.UniqueName];     
            cell.Attributes["headers"] = string.Format(CultureInfo.CurrentCulture, "header{0}", colno); ;     
            colno++;     
        }             
    }     
}    
 

1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 25 Feb 2010, 06:26 AM
Hello Ken,

I have transferred your code library submission to a forum post, so that other community members can benefit from it as well. I have updated your Telerik points for your involvement.
Thank you for your contribution.

Kind regards,
Yavor
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
Ken Lassesen
Top achievements
Rank 2
Answers by
Yavor
Telerik team
Share this question
or