Telerik RadGrid Section 508 Compliance

by Vladimir Enchev | Comments 9

Ever wonder how to make a pageable & sortable grid Section 508 compliant? Well with RadGrid this is trivial task! The tricky part is to tell the grid to not render or require any JavaScript on the page:

1. Inherit from RadGrid and override three methods:

    public class MyGrid : RadGrid
    {
        public MyGrid()
        {
            //
        }

        protected override void RegisterScriptControl()
        {
            // do not register as ScriptControl
        }

        protected override void RegisterScriptDescriptors()
        {
            // do not register script descriptors
        }

        protected override void RegisterCssReferences()
        {
            // do not register css references
        }
    }

2. Add the grid to your page, define header button type for all grid columns & pager template:

        <telerik:MyGrid ID="MyGrid1" Skin="Sunset" DataSourceID="LinqDataSource1" AllowPaging="true"
            AllowSorting="true" runat="server" OnColumnCreated="MyGrid1_ColumnCreated">
            <MasterTableView Caption="Customers" Summary="Customers">
                <PagerTemplate>
                    Change page: <asp:Button ID="Button1" ToolTip="Previous Page" CommandName="Page" CommandArgument="Prev" CssClass="rgPagePrev" runat="server" />
                    <asp:Button ID="Button2" ToolTip="Next Page" CommandName="Page" CommandArgument="Next" CssClass="rgPageNext" runat="server" />
                </PagerTemplate>
            </MasterTableView>
        </telerik:MyGrid>

    protected void MyGrid1_ColumnCreated(object sender, GridColumnCreatedEventArgs e)
    {
        e.Column.HeaderButtonType = GridHeaderButtonType.PushButton;
    }

3. Make the grid pretty:

<link type="text/css" rel="stylesheet" href="Skins/Sunset/Grid.Sunset.css" />
<style type="text/css">
    .RadGrid_<%= MyGrid1.Skin %> th input
    {
        border:0px;
        background-color: Transparent;
        font-weight:bold;
        cursor: pointer;
        color:White;
        text-align:left;
    }
</style>

Enjoy!

Live Demo | Download

,
Senior Technical Architect

9 Comments

Kevin Babcock
Great demo Enchev!
Partha
How exactly is this Section 508 compliant? It looks like any other grid.
Vlad
The key feature is that there is no JavaScript :). According to the standard your web site should be operational and informative when the JavaScript is turned off.
Ben
OK, but what about when JavaScript is enabled. Does this example degrade or is simply sans JavaScript.

Ben
Vlad
Hi Ben, Generally the grid in this demo will not render any JavaScript and CSS however if the JavaScript is enabled you can easily redirect to a page with full client-side capabilities. For example: <script type="text/javascript">     window.location.href = "Default2.aspx"; </script> Vlad
Neeraj
The problem is that I am loosing Menu of Column Filter on Click. Have any body had this problem with Column Filter when using this grid.
Ricardo
Hi, great post. i just have a quick question for you, do you know if the same process applies to RadListView to make a pageable list Section 508 compliant?
Ricardo
Hi, great post. i just have a quick question for you, do you know if the same process applies to RadListView to make a pageable list Section 508 compliant?
Chad
You can be 508 compliant and use JavaScript.

Comments

  1.    
      
      
       
  2. (optional, emails won't be shown on public pages)
  3. (optional)
Read more articles by Vladimir Enchev - or - read latest articles in Developer Tools


Follow vladimir_enchev on Twitter


Product Families