Including Data From DropDownList Into Gridview
Posted
by Mike Keller
on Stack Overflow
See other posts from Stack Overflow
or by Mike Keller
Published on 2010-04-22T19:45:48Z
Indexed on
2010/04/22
19:53 UTC
Read the original article
Hit count: 201
I feel a little embarassed posting two questions relating to the same problem, but the first one ended up answering a question that I believe is unrelated to the solution so I'm leaving it up and outlining what I'm trying to accomplish with the hopes that someone can help out a .Net noob.
What I need to be able to do is create a field in my gridview that contains a link that passes two variables. One is pulled from within the gridviews datasource and the other needs to be pulled from a textbox control outside the gridview.
From what I've read so far you cannot use a hyperlinkfield for this as the datanavigateurlfields cannot be set to pull from anything but the gridview's data source.
What I attempted to do was create a template field where in the itemtemplate I called:
<a href="example.aspx?e=<%# Eval(ExampleList.SelectedItem.Value) %>">Test</a>
That comes back with an error like this:
DataBinding: 'System.Data.DataRowView' does not contain a property with the value 'TestData'
Any clues to make this happen would be appreciated, like I said I'm pretty new to .Net so please be gentle. I tried to do my homework before posting this.
© Stack Overflow or respective owner