Varying the contents of a Dropdown within a Gridview

S

servernet1997

I have a gridview with 4 columns. Two of the columns are read-only and
two are editable. The two editable columns are listboxes leveraging an
ObjectDataSource. The first listbox is populated from a table of
static information, the second listbox is more problematic.

If the contents of the first listbox contains one specific value, I
want to populate the second listbox with the results of QueryA when
the row is edited. If the contents of the first listbox contains any
other value, I want to populate the listbox with the results of QueryB
when the row is edited.

QueryA and QueryB are performed against the same table, but require
different sets of parameters. Query A requires no parameters, QueryB
requires 1 parameter.

Can anyone point me in the right direction as to how I might achieve
this?
 
S

servernet1997

I have a gridview with 4 columns. Two of the columns are read-only and
two are editable. The two editable columns are listboxes leveraging an
ObjectDataSource. The first listbox is populated from a table of
static information, the second listbox is more problematic.

If the contents of the first listbox contains one specific value, I
want to populate the second listbox with the results of QueryA when
the row is edited. If the contents of the first listbox contains any
other value, I want to populate the listbox with the results of QueryB
when the row is edited.

QueryA and QueryB are performed against the same table, but require
different sets of parameters. Query A requires no parameters, QueryB
requires 1 parameter.

Can anyone point me in the right direction as to how I might achieve
this?

I should also add, that I need to do 2-way data binding with the
dropdown lists so that the table that underlies the Gridview is
updated.
 

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,772
Messages
2,569,593
Members
45,111
Latest member
KetoBurn
Top