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

2 posts, 0 answers
  1. Ken Lassesen
    Ken Lassesen avatar
    37 posts
    Member since:
    Nov 2008

    Posted 19 Feb 2010 Link to this post

    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++;     
            }             
        }     
    }    
     

  2. Yavor
    Admin
    Yavor avatar
    11 posts

    Posted 25 Feb 2010 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top