Link to home
Start Free TrialLog in
Avatar of arcross
arcrossFlag for United Kingdom of Great Britain and Northern Ireland

asked on

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??
ASKER CERTIFIED SOLUTION
Avatar of Alfred A.
Alfred A.
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial