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:hyperlinkc olumn datanavigateurl field="ID"
datanavigateurl formatstring="A dCampaignDetail s.aspx?Campaign ID={0}"
datatextfield=" Title" headertext="Tit le"></asp:hyperlinkco lumn>
My problem is, I'd like to pass not only the the CampaignID to the
AdCampaignDetai ls page, but also the CustomerID so that the resulting
DataNavigateURL FormatString should look like:
"AdCampaignDeta ils.aspx?Custom erID=8&Campaign ID={0}"
As mentioned above, the CustomerID is passed to the CustomerDetails .aspx
page.
Q: Can I specify multiple string.Format params in the
DataNavigateURL FormatString? 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 1326
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:hyperlinkc olumn datanavigateurl field="ID" datanavigateurl formatstring="A dCampaignDetail s.aspx?Campaign ID={0}" datatextfield=" Title" headertext="Tit le"></asp:hyperlinkco lumn>
My problem is, I'd like to pass not only the the CampaignID to the AdCampaignDetai ls page, but also the CustomerID so that the resulting DataNavigateURL FormatString should look like: "AdCampaignDeta ils.aspx?Custom erID=8&Campaign ID={0}"
As mentioned above, the CustomerID is passed to the CustomerDetails .aspx page.
Q: Can I specify multiple string.Format params in the DataNavigateURL FormatString? 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:hyperlinkc olumn datanavigateurl field="ID" datanavigateurl formatstring="A dCampaignDetail s.aspx?Campaign ID={0}" datatextfield=" Title" headertext="Tit le"></asp:hyperlinkco lumn>
My problem is, I'd like to pass not only the the CampaignID to the AdCampaignDetai ls page, but also the CustomerID so that the resulting DataNavigateURL FormatString should look like: "AdCampaignDeta ils.aspx?Custom erID=8&Campaign ID={0}"
As mentioned above, the CustomerID is passed to the CustomerDetails .aspx page.
Q: Can I specify multiple string.Format params in the DataNavigateURL FormatString? 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:hyperlinkc olumn datanavigateurl field="ID" datanavigateurl formatstring="A dCampaignDetail s.aspx?Campaign ID={0}" datatextfield=" Title" headertext="Tit le"></asp:hyperlinkco lumn>
My problem is, I'd like to pass not only the the CampaignID to the AdCampaignDetai ls page, but also the CustomerID so that the resulting DataNavigateURL FormatString should look like: "AdCampaignDeta ils.aspx?Custom erID=8&Campaign ID={0}"
As mentioned above, the CustomerID is passed to the CustomerDetails .aspx page.
Q: Can I specify multiple string.Format params in the DataNavigateURL FormatString? 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 columns. Three are
databound to a dataset and one is a template column. I
need to be able to access each item in the template
column (getting access to the hyperlink) then adding an
attribute to call some client side code. Does anyone
know...
|
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 it to look like the following where the URL column is
clickable.
---------------------------------------------
|
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 conversion is extremely costly in performance. Does anybody know how I could set the label (of the whole content of the TableCell) to .Visible = False without converting e.Item.Controls(2) to a System.Web.UI.WebControls.Label?
|
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 = datagrid.Items(rownumber).Cells.Item(column number).Text
returns a blank string. It seems to work ok for the other columns that are
just regular datagrid columns, not hyperlink types.
Thanks.
--
Paul G
Software engineer.
|
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 side SelectedIndexChanged event of
the listbox.
Any help in VB.NET would be greatly appreciated.
Thanks
| |
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 colors changing, and I have the
routine, but I can't seem to get the HyperLinkColumn to fire....
Private Sub MyDataGrid_ItemDataBound(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs) Handles...
|
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 with a Control
HyperLink.
I would like to fix many properties of this Control Hyperlink in the Code
|
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 columns in it but i need to add a sixth column
which will be my checkbox column - any help or pointers with this
would be great
|
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 can get this to work; however, the column header on the
datagrid is not a link/sortable.
What am I missing?
Thanks in advance.
|
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 datagrida. I would like to set it so that
if value of column 3 in datagrid 1 is < 100 set to red, if = 100 set to green
if value of column 3 in datagrid 2 is < 90 set to red, if >= 90 set to green
if value of column 3 in datagrid 3is < 80 set to red,...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| | |