Template Column data depending on form data

J

John Mackerras

Langauage C#

I have a webform containing a dropdown control and a datagrid. A different
query is fired depending on the value of the dropdown grid, i.e. if the
dropdown grid.value = "a" then SQL queryA is fired, if the dropdown
grid.value = "b" then SQL queryB is fired.

There is a column in the datagrid for which the results depend on the query
so I need to be able to detect which value the dropdownist is.

I have tried

<asp:TemplateColumn>
<ItemTemplate>
<%# GetSecondColumn(Container) %>
</ItemTemplate>
</asp:TemplateColumn>

and letting the procedure GetSecondColumn() find the value, but
DropDownList1.SelectedValue is not visible to the public procedure.

How can I tell GetSecondColumn() what the value is of the form control
DropDownList1.SelectedValue, so I can chose which data to return.

Thanks

John
 

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,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top