views:

96

answers:

2

I have six DropDownLists arranged in pairs Name and Key. They operate in the sense of you choose a Channel Partner and then that filters down and rebinds the Head Office and so forth.

It works fine so far but I want to be able to have it so that each pair of DropDownLists are triggered by the ones above. How would I do this?

I have thought about and tried wrapping the last two pairs with UpdatePanels so that only those would be triggered. But haven't had much luck. Any help would be greatly appreciated :)

the code so far is:

<table>
 <tr id="trCP" runat="server">
  <td>Channel Partners</td>
  <td><asp:DropDownList ID="ddlChannelPartners" runat="server" AutoPostBack="True" CssClass="name" OnSelectedIndexChanged="ddlChannelPartners_SelectedIndexChanged" /></td>
  <td><asp:DropDownList ID="ddlChannelPartnersKey" runat="server" AutoPostBack="True" CssClass="code" OnSelectedIndexChanged="ddlChannelPartnersKey_SelectedIndexChanged" /></td>
 </tr>

 <tr>
  <td>Head Companys</td>
  <td><asp:DropDownList ID="ddlHeadCompanies" runat="server" AutoPostBack="True" CssClass="name" OnSelectedIndexChanged="ddlHeadCompanies_SelectedIndexChanged" /></td>
  <td><asp:DropDownList ID="ddlHeadCompaniesKey" runat="server" AutoPostBack="True" CssClass="code" OnSelectedIndexChanged="ddlHeadCompaniesKey_SelectedIndexChanged" /></td>
 </tr>

 <tr>
  <td>Clients</td>
  <td><asp:DropDownList ID="ddlClients" runat="server" AutoPostBack="True" CssClass="name" OnSelectedIndexChanged="ddlClients_SelectedIndexChanged" /></td>
  <td><asp:DropDownList ID="ddlClientsKey" runat="server" AutoPostBack="True" CssClass="code" OnSelectedIndexChanged="ddlClientsKey_SelectedIndexChanged" /></td>
 </tr> 

 <tr>
  <td colspan="3">
   <asp:Button ID="btnOK" runat="server" UseSubmitBehavior="true" Text="OK" OnClick="btnOK_Click" />
  </td>
 </tr>
</table>
A: 

Have you seen the CascadingDropDown in the AjaxControlToolkit? I think that'll do a lot of what you want.

PhilPursglove
I have seen the CascadingDropDown but I don't think that is really what I am after. Thank you though
Malachi
+1  A: 
  1. There is good implmentation of same problem over CascadingDropDown in AJAXControlToolkit. Ok may be it is not your way.
  2. Place pairs in separate UpdatePanels
Dewfy
How would I write the triggers for the client DDL's if the Head Office DDL's are wrapped inside a UpdatePanel?
Malachi
(1) - most reliable use small jsavascript to nudge another updatePanel, (2) Each updatePanel has own set of Triggers - so you can even create cross-update panel references,
Dewfy