How Do? Modify CssClass for Specific Select Column in Datagrid

J

Joey

I have noticed that the grid's Select linkbutton is rendered as an HTML
anchor tag on the client. I would really like to be able to get a
"class" attribute in it, either through CssClass on the serverside
DataGridLinkButton control or through Attributes.Add or something
similar?

I thought I could use ItemDataBound and
((DataGridLinkButton)e.Item.Cells[6].Controls[0]).CssClass, but it says
that DataGridLinkButton is inaccessible to its protection level. I have
a couple of other approaches
(this.grdMyGrid.Columns[6].ItemStyle.CssClass <- changes the cell
style, but not the anchor tag within it ; also tried page-level style
for anchor tag, but I need that for other anchor elements on the page),
but they didn't work either.

Any ideas?
 
J

Joey

I finally got it. Should have used LinkButton, even though GetType()
was returning DataGridLinkButton.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top