asp:hyperlinkcolumn

fitta

New Member
How can I specify that the link in my hyperlinkcolumn should have no underline?Here's one way.<BR>I'll assume your hyperlink is in a datagrid and it's the first column of the datagrid and that the id for the datagrid is "searchResults".<BR><BR>In your code behind you'll have an "ItemDataBound" event for your control. This is the time that in this case the datagrid is being populated.<BR><BR>Private Sub searchResults_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles SearchResults.ItemDataBound<BR> Dim itemType As ListItemType = e.Item.ItemType<BR> If ((itemType = ListItemType.Pager) Or (itemType = ListItemType.Header) Or (itemType = ListItemType.Footer)) Then<BR> Return<BR> Else<BR> e.Item.Cells(0).Style.Item("textDecoration") = "none"<BR> End If<BR>End Sub<BR><BR>If you don't have a datagrid in your case I'm sure you'll be able to adapt this code to fit your needs.<BR><BR>hth<BR><BR>matt
 
Back
Top