2

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...

2 Answers 2

1

Make use of Attributes.Add

Example

e.Row.Cells[1].Attributes.Add("class", "text")
Sign up to request clarification or add additional context in comments.

Comments

0

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")

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.