Check Box inside Rad Grid 508 Compliance

Many times we used check box inside a grid like :

<telerik:GridTemplateColumn UniqueName="ColoumnChk" HeaderText="Check Here">
        <ItemTemplate>
             <asp:CheckBox ID="chkNew" AutoPostBack="true" runat="server" Text="Abc" />
         </ItemTemplate>
 </telerik:GridTemplateColumn>

 But some time we need to hide check box text like : 

<telerik:GridTemplateColumn UniqueName="ColoumnChk" HeaderText="Check Here">
        <ItemTemplate>
             <asp:CheckBox ID="chkNew" AutoPostBack="true" runat="server" Text="" />
         </ItemTemplate>
 </telerik:GridTemplateColumn>

In this case an accessibility error(508 Compliance) will occur. So for treat this error we have to provide check box text and hide that using a CSS class like :

<telerik:GridTemplateColumn UniqueName="ColoumnChk" HeaderText="Check Here">
  <ItemTemplate>
   <asp:CheckBox ID="chkNew" AutoPostBack="true" runat="server" Text="Abc" CssClass="MyClass" />
 </ItemTemplate>
</telerik:GridTemplateColumn>

Our CSS class is here : 

<style type="text/css">
    .MyClass label
        {
            display:none;
        }
</style>


Comments

Popular posts from this blog

C# Copy files from one server to another

Suppress StyleCop SA1600

Telerik Rad Grid Sorting