473,386 Members | 1,830 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,386 software developers and data experts.

DataGrid, Hyperlink Column Question

Hi,

I've got a DataGrid which is displayed within a CustomerDetails page.
The CustomerDetails data (including the data for the grid) is loaded
using a QueryString (Item CustomerID) which is passed to this aspx page.

The hyperlink column looks like this:

<asp:hyperlinkcolumn datanavigateurlfield="ID"
datanavigateurlformatstring="AdCampaignDetails.asp x?CampaignID={0}"
datatextfield="Title" headertext="Title"></asp:hyperlinkcolumn>

My problem is, I'd like to pass not only the the CampaignID to the
AdCampaignDetails page, but also the CustomerID so that the resulting
DataNavigateURLFormatString should look like:
"AdCampaignDetails.aspx?CustomerID=8&CampaignID={0 }"

As mentioned above, the CustomerID is passed to the CustomerDetails.aspx
page.

Q: Can I specify multiple string.Format params in the
DataNavigateURLFormatString? If so, how do I specify the data filled in?
I've been looking at the DataGrids Columns collection to see if I can do
it that way, but no success. Any help?

Thanks in advance!
--
/Matthias
Nov 19 '05 #1
3 1310
Nope. You'll have to handle the RowDatabound event for the DataGrid then
find the control yourself or add a new one yourself that has the NavigateUrl
you really want.

-Brock
DevelopMentor
http://staff.develop.com/ballen
Hi,

I've got a DataGrid which is displayed within a CustomerDetails page.
The CustomerDetails data (including the data for the grid) is loaded
using a QueryString (Item CustomerID) which is passed to this aspx
page.

The hyperlink column looks like this:

<asp:hyperlinkcolumn datanavigateurlfield="ID"
datanavigateurlformatstring="AdCampaignDetails.asp x?CampaignID={0}"
datatextfield="Title" headertext="Title"></asp:hyperlinkcolumn>

My problem is, I'd like to pass not only the the CampaignID to the
AdCampaignDetails page, but also the CustomerID so that the resulting
DataNavigateURLFormatString should look like:
"AdCampaignDetails.aspx?CustomerID=8&CampaignID={0 }"

As mentioned above, the CustomerID is passed to the
CustomerDetails.aspx page.

Q: Can I specify multiple string.Format params in the
DataNavigateURLFormatString? If so, how do I specify the data filled
in? I've been looking at the DataGrids Columns collection to see if I
can do it that way, but no success. Any help?

Thanks in advance!


Nov 19 '05 #2
Hi Brock,

I guess you meant the ItemDataBound event. Got the job done, thanks for
the pointer.

/Matthias

Brock Allen wrote:
Nope. You'll have to handle the RowDatabound event for the DataGrid then
find the control yourself or add a new one yourself that has the
NavigateUrl you really want.

-Brock
DevelopMentor
http://staff.develop.com/ballen
Hi,

I've got a DataGrid which is displayed within a CustomerDetails page.
The CustomerDetails data (including the data for the grid) is loaded
using a QueryString (Item CustomerID) which is passed to this aspx
page.

The hyperlink column looks like this:

<asp:hyperlinkcolumn datanavigateurlfield="ID"
datanavigateurlformatstring="AdCampaignDetails.asp x?CampaignID={0}"
datatextfield="Title" headertext="Title"></asp:hyperlinkcolumn>

My problem is, I'd like to pass not only the the CampaignID to the
AdCampaignDetails page, but also the CustomerID so that the resulting
DataNavigateURLFormatString should look like:
"AdCampaignDetails.aspx?CustomerID=8&CampaignID={0 }"

As mentioned above, the CustomerID is passed to the
CustomerDetails.aspx page.

Q: Can I specify multiple string.Format params in the
DataNavigateURLFormatString? If so, how do I specify the data filled
in? I've been looking at the DataGrids Columns collection to see if I
can do it that way, but no success. Any help?

Thanks in advance!


Nov 19 '05 #3
Oops, Yep -- RowDataBound is the GridView in 2.0. Sorry.

-Brock
DevelopMentor
http://staff.develop.com/ballen
Hi Brock,

I guess you meant the ItemDataBound event. Got the job done, thanks
for the pointer.

/Matthias

Brock Allen wrote:
Nope. You'll have to handle the RowDatabound event for the DataGrid
then find the control yourself or add a new one yourself that has the
NavigateUrl you really want.

-Brock
DevelopMentor
http://staff.develop.com/ballen
Hi,

I've got a DataGrid which is displayed within a CustomerDetails
page. The CustomerDetails data (including the data for the grid) is
loaded using a QueryString (Item CustomerID) which is passed to this
aspx page.

The hyperlink column looks like this:

<asp:hyperlinkcolumn datanavigateurlfield="ID"
datanavigateurlformatstring="AdCampaignDetails.asp x?CampaignID={0}"
datatextfield="Title" headertext="Title"></asp:hyperlinkcolumn>

My problem is, I'd like to pass not only the the CampaignID to the
AdCampaignDetails page, but also the CustomerID so that the
resulting DataNavigateURLFormatString should look like:
"AdCampaignDetails.aspx?CustomerID=8&CampaignID={0 }"

As mentioned above, the CustomerID is passed to the
CustomerDetails.aspx page.

Q: Can I specify multiple string.Format params in the
DataNavigateURLFormatString? If so, how do I specify the data filled
in? I've been looking at the DataGrids Columns collection to see if
I can do it that way, but no success. Any help?

Thanks in advance!


Nov 19 '05 #4

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

Similar topics

2
by: damonf | last post by:
I'm currently trying to add an ASP hyperlink to a template column in a datagrid. The normal hyperlink column doesn't give me the ability to add attributes to the item. In my grid there are four...
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...
12
by: Daniel Walzenbach | last post by:
Hi, I want to display a Label in a DataGrid according to some condition. I therefore check whether the condition is true in the ItemDateBound EventHandler of the DataGrid. Unfortunately the...
9
by: Paul | last post by:
Hi I have a data grid with a hyperlink column. the colum has numbers like 00001,000002, ect. Just wondering how to get the text value of the cell as tempstring =...
3
by: Raja | last post by:
I have a simple question, I have a datagrid and inside the grid, i have List box. I am able to render the page with the datagrid and the lisbox values. Now, my question is how to trap the server...
4
by: sakieboy | last post by:
I currently have a datagrid with several columns. The first column in the DataGrid is a HyperLinkColumn. When I select a row, I would like for this HyperlinkColumn to fire. I have the mouseover...
2
by: Fabrice | last post by:
Hello, First, thanks to felix for his answer. But :-( , I'm feeling newbie :! I' don't understand all the situation. The trouble : Always in the road whith my Datagrid and my ItemTemplate...
17
by: Mike Fellows | last post by:
im trying (unsucessfully) to add a checkbox column to my datagrid i basically have a datagrid that im populating from a dataset Me.DataGrid1.DataSource = ds.Tables(0) the datagrid then has 5...
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...
2
by: Mike Baugh | last post by:
I am using visual studio 2005 to develop a form using c# I have 3 datagrids on one form. I can set the row color based on a certain value in a column. However this color applies to all 3...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.