.NETGURU
Need help with Hyperlink Column in DataGrid!
Messages   Related Types
This message was discovered on microsoft.public.dotnet.framework.aspnet.

Post a new message to this list...

Jack Black
Hi, all!

I'm trying to build a hyperlink column in a DataGrid whose textField
is one column in the query, but whose URL needs to dynamically contain
the data from another.

For example, I want to display a book title (column = "Title"), but
the URL needs to be:
myPage.aspx?book=ISBN (where ISBN is a column name)

I'm building this with the designer, and not by manually writing out
the DataGrid and HyperLinkColumn tags. I've tried setting the URL
properties in the designer to a number of different things, but I only
get either the data column ALONE in place of the URL, or it isn't
processing the {0} portion of the URL (presumably this is an index
value, but since I can't find a single shred of documentation on this
convention, I'm guessing here)...

Tried a few different approaches, but can't get there... Suggestions?

Jack

Reply to this message...
 
    
Hermit Dave
set the column as template column... and then add hyperlink
for the navigate url.. use
navigateURL = '<%# "myPage.aspx?book=" + DataBind(Container.DataItem,
"columnname") %>'
something like that

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
"Jack Black" <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...
 
    
Jack Black
Dave, thanks for responding! I tried that, and it still didn't work.
For some bizarre reason, using the "{0} nomenclature in the
URLFormatString property magically started working, after not having
worked all afternoon. Go figure. 8-|

Thanks again for the tip! I'll probably try to get your suggestion to
work anyway so I have other options in the ol' toolbag! :)

Jack

On Fri, 10 Sep 2004 22:25:29 +0100, "Hermit Dave"
<Click here to reveal e-mail address> wrote:

[Original message clipped]

Reply to this message...
 
 
System.ComponentModel.Container
System.Web.UI.WebControls.DataGrid
System.Web.UI.WebControls.HyperLinkColumn
System.Windows.Forms.DataGrid




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