Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How Do? Modify CssClass for Specific Select Column in Datagrid

Reply
Thread Tools

How Do? Modify CssClass for Specific Select Column in Datagrid

 
 
Joey
Guest
Posts: n/a
 
      01-16-2006
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?

 
Reply With Quote
 
 
 
 
Joey
Guest
Posts: n/a
 
      01-17-2006
I finally got it. Should have used LinkButton, even though GetType()
was returning DataGridLinkButton.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
GridView - how do i modify bound data column by column? TS ASP .Net Web Controls 3 08-16-2007 05:02 AM
GridView - Setting the text of the 'select' column to the value of another column Greg Smith ASP .Net 0 04-12-2007 03:11 PM
bind a dropdown in a column in a datagrid based on the dropdown value selected in another column of the datagrid. vishnu ASP .Net 1 03-25-2006 01:24 PM
modify the default option in a select changing another select WebRaster Javascript 1 10-26-2005 10:36 AM
how do i access a dropdownlists selected value in a datagrid edititemtemplate column from the selectedindexchanged event of another dropdownlist in a datagrid edititemtemplate column Dave M ASP .Net Datagrid Control 0 12-14-2004 11:53 AM



Advertisments