.NETGURU
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




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification