DataGrid, Hyperlink Column Question

M

Matthias S.

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.aspx?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!
 
B

Brock Allen

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.
 
M

Matthias S.

Hi Brock,

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

/Matthias
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,480
Members
44,900
Latest member
Nell636132

Latest Threads

Top