473,397 Members | 2,099 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Need help with Hyperlink Column in DataGrid!

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

Nov 18 '05 #1
2 1254
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" <ja********@hotmail.com> wrote in message
news:mk********************************@4ax.com...
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

Nov 18 '05 #2
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"
<he************@CAPS.AND.DOTS.hotmail.com> wrote:
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


Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Amir Eshterayeh | last post by:
Dear Friends I put a asp.net hyperlink control inside a datagrid as even a template column or hyperlink column but can not force datagrid to open a new window when I clicked on the hyperlink. I...
1
by: Jeremy | last post by:
In a datagrid which contains a hyperlink column, can I programatically change a specific row's hyperlink ? The hyperlink build in by the designer applies to all rows - I'd like to change each...
0
by: MattB | last post by:
I got a response earlier, but I thought I'd bump this one to the top for a quick answer. Any tips, suggestions, or especially examples would be great! It seems like I may be able to do this...
1
by: Soul | last post by:
Hi, I have a column in my DataGrid which is a Hyperlink Column. Everything work fine except when I try to get the text of the column using this.DataGrid.SelectedItem.Cells.Text, I got blank...
2
by: Alex | last post by:
I would like to have one column in my DataGrid that content acts as a hyperlink. In addition to that I would like that the content is databound to a DataSet source. If I create a hyperlink...
2
by: Alex | last post by:
I'm reposting my issue with some more info. I would like to use a DataGrid to display my DataSet. My DataSet is from a table in a SQL DB. Both columns in the table are strings. I would like...
6
by: GaryB | last post by:
Does anyone have any idea how to get the text out of a hyperlink column in a web datagrid? It's a hyperlink column, not a template column so findcontrol does not work and there is no apparent...
3
by: Tim::.. | last post by:
I currently have the following datagrid but want to turn the name and email column into a hyperlink in the codebehind! Can someone please tell me how I achieve this! Thanks Private Sub...
3
by: TPhelps | last post by:
I have a sample of an unbound (autogeneratecolumns is true) sortable/pagable datagrid that works. I want to change one of the columns to a hyperlink. The examples I find use a bound column. I...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.