Skip to content

Commit

Permalink
Close #63: Use THEAD tag for table header,
Browse files Browse the repository at this point in the history
also utilize UseAccessibleHeader property to set scope="col" attributes instead of adding them manually
  • Loading branch information
roman-yagodin committed Sep 27, 2017
1 parent 135493f commit c0103b2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
2 changes: 1 addition & 1 deletion R7.Documents/ViewDocuments.ascx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<%@ Control Language="C#" AutoEventWireup="false" CodeBehind="ViewDocuments.ascx.cs" Inherits="R7.Documents.ViewDocuments" %>
<div class="ViewDocuments">
<asp:GridView id="grdDocuments" runat="server" DataKeyField="ItemID" EnableViewState="false" AutoGenerateColumns="false"
OnSorting="grdDocuments_Sorting" OnRowCreated="grdDocuments_RowCreated">
UseAccessibleHeader="true" OnSorting="grdDocuments_Sorting" OnRowCreated="grdDocuments_RowCreated">
<Columns>
<asp:TemplateField>
<ItemTemplate>
Expand Down
9 changes: 1 addition & 8 deletions R7.Documents/ViewDocuments.ascx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,15 +182,8 @@ protected void grdDocuments_RowCreated (object sender, GridViewRowEventArgs e)

switch (e.Row.RowType) {
case DataControlRowType.Header:
// set CSS class for edit column header
e.Row.TableSection = TableRowSection.TableHeader;
e.Row.Cells [0].CssClass = "EditHeader";

// TODO: Doesn't UseAccessibleHeader=true does same thing?
// setting "scope" to "col" indicates to for text-to-speech
// or braille readers that this row containes headings
for (var count = 1; count <= e.Row.Cells.Count - 1; count++) {
e.Row.Cells [count].Attributes.Add ("scope", "col");
}
break;

case DataControlRowType.DataRow:
Expand Down

0 comments on commit c0103b2

Please sign in to comment.