|
-
Mar 23rd, 2003, 12:49 PM
#1
Thread Starter
PowerPoster
Help with formatting a HyperLinkColumn in Datagrid
Here is what I am doing in a datagrid for the colums:
Code:
<Columns>
<asp:HyperLinkColumn DataNavigateUrlField="CatID"
DataNavigateUrlFormatString=
"../VXForums/Index.aspx?CatID={0}"
DataTextField="CatName" HeaderText="Category">
</asp:HyperLinkColumn>
<asp:BoundColumn DataField="CatDescription"
HeaderText="Description">
</asp:BoundColumn>
</Columns>
The problem I have is I want two values in the query string, both comming from the dataset that is databound to the datagrid. Right now, the link looks like this when ran:
../VXForums/Index.aspx?CatID=1
../VXForums/Index.aspx?CatID=2
etc...
I want it to look like this:
../VXForums/Index.aspx?CatID=1&SecID=8
../VXForums/Index.aspx?CatID=2&SecID=9
etc...
The SecID is comming from the dataset.
So the question is, how do I get two values from the dataset into the DataNavigateUrlFormatString property, and/or how do I get two values into the DataNavigateUrlField?
If you need more information, just ask, this is pretty important to the project.
-
Mar 23rd, 2003, 01:22 PM
#2
Thread Starter
PowerPoster
Never mind, I used a custom binding expression to achieve what I wanted.
Here is the expression in case someone else has this problem.
DataBinder.Eval(Container, "DataItem.CatID", "../VXForums/Index.aspx?CatID={0}") + DataBinder.Eval(Container, "DataItem.SecID","&SecID={0}")
-
Mar 24th, 2003, 08:08 AM
#3
Lively Member
thanks for the code tip... i wondered the same a few days ago.
-
Mar 24th, 2003, 11:04 AM
#4
Thread Starter
PowerPoster
Glad to help out. It took me a while to figure it out.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|