I have two DropDownLists that are in a GridView. The DropDownLists only show when the GridView is in edit mode. The first DropDownList is filled correctly. Based on the selection in the first DropDownList, the selected value will be an input into the query for the second DropDownList. How do I go about doing this in C#? What sort of parameter do I define for the second DropDownList? The DebtorKey is what comes from the first DropDownList.
ASP code for the second DropDownList
<asp:ObjectDataSource ID="ObjectDataSourceSpokeTo" runat="server"
OldValuesParameterFormatString="original_{0}" SelectMethod="GetData"
TypeName="ValidationPortal.VerificationDataSetTableAdapters.getSpokeToTableAdapter">
<SelectParameters>
<asp:ControlParameter ControlID="GridView1" DefaultValue="0" Name="DebtorKey"
PropertyName="SelectedValue" Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
In the SelectedIndexChanged of the first dropdown, you can implement your query to populate the second dropdown.
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
// if x is selected in dropdown1, populate dropdown2
}