Dropdown in gridview failing when objectdatasource.FilterExpression is applied.

Hello,
I ve got a datagrid with 2 dropdownlists in the edit template.
What Im trying to do is to filter the second list based on the selection on the first one.

Both dropdowns are bind to an objectdatasrouce. So when I select an item from the first one, in the 'SelectedIndexChanged' event i doing something like

if list1.selecteditem.text = "WHATEVER" then
     objectdatasource_secondlist.filterexpression = "field=xxx"
else
.....

But i get this error everytime:
"Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control."

The second dropdown is bound to field like bind("field").

any ideas??
LVL 8
arcrossAsked:
Who is Participating?
 
Alfred A.Commented:
And here is one based on two dropdownlist:

http://forums.asp.net/t/1032264.aspx

And here is one in EE that can help:

http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/Q_23400559.html

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.