Datagrid hyperlinks
Messages   Related Types
This message was discovered on microsoft.public.dotnet.framework.aspnet.

Post a new message to this list...

Graeme
Hello

I thought if I linked a datagrid column to a field containing something like
this ... <a href="http://www.google.com"" target="_blank">http://www.google.com";
target="_blank">http://www.google.com</a> ... that it might appear
hyperlinkable in the grid. But alas, no.

What I currently have is a non-template bound column connecting a data field
which may contain, amongst other text, a URL (or maybe an Email address). Is
there any way to have just the URL part hyperlinkable so user can click and
redirect?

Or do I HAVE to use a Hyperlink column for this? Problem I see here is that
I only want the URL part hyperlinkable; not the complete text (which could
be several sentences).

Any ideas most welcome.

Thanks
Graeme

Reply to this message...
 
    
Konrad Rotuski
"Graeme" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

probably this is escaped to <a href= ... hope you get the idea, thats why
its not hyperlink in the grid

[Original message clipped]

simplest way to accomplish this would be to use TemplateColumn

HTH

Konrad

[Original message clipped]

Reply to this message...
 
    
Graeme
Thanks for quick response, Konrad! Well, I did try template but still stuck
.... how to make it grab the tags and make it hyperlinkable? Can you help
more? Thanks

"Konrad Rotuski" <Click here to reveal e-mail address> wrote in message
news:%23%Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
Konrad Rotuski
<asp:TemplateColumn>
<ItemTemplate>
some text, not hyperlinkable <a
href='http://www.google.com'>hyperlink text</a> some more nothyperlinkable
text <%#DataBinder.Eval(Container.DataItem, "SomeColumn")%>
<ItemTemplate>
</asp:TemplateColumn>

what do you mean by 'grab the tags' .. i dont get it .. ?

Konrad

"Graeme" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
> Thanks for quick response, Konrad! Well, I did try template but still
stuck
[Original message clipped]

Reply to this message...
 
    
Graeme
Just my uneducated terminology. I'll have a play with this tomorrow. Thanks!
"Konrad Rotuski" <Click here to reveal e-mail address> wrote in message
news:O%Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
Eeediot
You can also use the SPAN tag:

<span onclick="...">some text</span>

But this only works with web browsers that support HTML 4.

"Graeme" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
Graeme
Sorry ... worked all the time! I wasn't storing it in correct format in db.
Graeme (AKA Oaf)
"Graeme" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
 
System.ComponentModel.Container
System.Web.UI.DataBinder
System.Web.UI.WebControls.TemplateColumn




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com