Reputation: 881
I changed a gridview's header to ... with
Sub MakeAccessible(ByVal grid As GridView)
If grid.Rows.Count > 0 Then
grid.UseAccessibleHeader = True
grid.HeaderRow.TableSection = TableRowSection.TableHeader
grid.HeaderRow.CssClass = ""
'grid.FooterRow.TableSection = TableRowSection.TableFooter
End If
End Sub
Now I need to add attributes to the th tags like th xyz=boom. How to do so?
Thx a lot for your help and interest...
Upvotes: 2
Views: 4423
Reputation: 3
You can add the attribute to the header row by adding by adding the following to your sub
grid.HeaderRow.Cells[2].Attributes.Add("xyz", "boom")
Upvotes: 0
Reputation: 176896
Make use of Attributes.Add
Example
e.Row.Cells[1].Attributes.Add("class", "text")
Upvotes: 1