I tried:
ButtonColumn butTemp = new ButtonColumn();
butTemp.ButtonType = ButtonColumnType.LinkButton;
butTemp.CommandName = "EDIT";
butTemp.Text = <determined by a database entry>
butTemp.HeaderText = "Document Description";
butTemp.ItemStyle.Font.Underline = false;
But that doesn't remove the underline. Is there a way to remove the underline?
I tried removing the line with a regular LinkButton on a WebForm and I was able to remove the underline on a regular LinkButton, but I haven't found a way to do it in the DataGrid.
this is how I removed the underline on the LinkButton:
LinkButton lb = new LinkButton();
lb.Attributes.Add("text-decoration", "none");
whereas the example below will set style on a specific anchor element whose
class attribute is set to the following class.
<STYLE TYPE="text/css">
.Buttoncolumn { color: darkred; font-size:14pt; } /* unvisited link */
.Buttoncolumn:visited { color: indianred; text-decoration: none} /*
visited link */
.Buttoncolumn:active { color: gold;text-decoration: none } /* active
link */
.Buttoncolumn:hover { color: darkgreen; text-decoration: none} /*
hover or mousover link */
</STYLE>
now just pass the class to your bound column :
butTemp.ItemStyle.CssClass = "Buttoncolumn"
For a quick tutorial reference below :
http://www.w3schools.com/css/css_pseudo_classes.asp
"Angela" <Angela....@globalcrossing.com> wrote in message
news:FAA952D7-9310-40D6...@microsoft.com...
Thank you for posting in the community!
You can just follow Alessandro's reply to use CssClass to hide the
underline.
What I want to add is why ButtonColumn.ItemStyle.Font.Underline = false
does not work:
LinkButton will render as <a> html tag, and the default style for <a> will
have underline. So the underline is a part of the link element(<a>), not a
part of Font(Which will default has no underline, you can determine this
through Response.Write(ButtonColumn.ItemStyle.Font.Underline.ToString())),
so you should use css attribute "text-decoration: none" to hide the
underline.
Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Does my reply make sense to you?
If you have anything unclear, please feel free to feedback. I will help you.