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 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!
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!
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! This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
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...
|
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...
|
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 =...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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,...
|
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...
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
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...
|
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,...
|
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...
| | |