title: How to get id of the selected item in combobox and populate another combobox with it?
body: <p>I have 2 comboboxes created with <code>Ajax Toolkit</code>. One of them has a list of systems. I wanted to fill the other combobox with a list of subsystems whenever a system is selected. I did not use <code>DisplayMember</code> or <code>ValueMember</code> and most examples are using them.
  .aspx side just in case:</p>
  
  <pre><code>&lt;ajaxToolkit:ComboBox ID="cbox1" runat="server" OnSelectedIndexChanged="cbox1_SelectedIndexChanged" /&gt;
  </code></pre>
  
  <p>Is this doable with what I'm trying? Is the event I used correct for the situation?(I guess not,but other events seem to be unrelated) Let me show you the code:</p>
  
  <pre><code>protected void fillSystemCombo()
          {
              var sysOperations = new ModelOperations.ConstantSystem.ConstantSystemOperations();
              var sys = sysOperations.GetSystemList().TransactionResultList;
  
              foreach (var item in sys)
              {
                  cbox1.Items.Add(item.description);
              }
          }
  </code></pre>
  
  <p>This works fine and I can see the systems in my first combobox.</p>
  
  <p>This is what I tried for populating the second one:</p>
  
  <pre><code>protected void cbox1_SelectedIndexChanged(object sender, EventArgs e)
          {
              var subSysOperations = new ModelOperations.ConstantSubSystem.ConstantSubSystemOperations();
              int index = Convert.ToInt32(cbox1.SelectedItem.Value);//i think this should get the id...
  
              var subsys = subSysOperations.GetSubSystemList().TransactionResultList;
  
              foreach (var item in subsys)
              {
                  if (item.sysID == index)
                  {
                      cbox2.Items.Add(item.description);
                  }
              }
          }
  </code></pre>
  
  <p><code>sysID</code> is the foreign key in SubSystem which is the <code>ID</code> of System. By the way, my <code>SelectedIndexChanged</code> event never fired when I was debugging the program even though I clicked on an item in combobox. </p>