title: How to get key from SelectedItem of ComboBox?
body: <p>I am trying to get the key of <code>SelectedItem</code> of <code>ComboBox</code> but do not figure it out how to get code which I have done is,    </p>
  
  <pre><code>void CboBoxSortingDatagridview(ComboBox sender)
  {
      foreach (var v in DictionaryCellValueNeeded)
      {
          if (!DictionaryGeneralUsers.ContainsKey(v.Key) &amp;&amp; v.Value.RoleId == Convert.ToInt32(((ComboBox)sender).SelectedItem)) // here getting value {1,Admin} i want key value which is 1 but how?
          {
              DictionaryGeneralUsers.Add(v.Key, (GeneralUser)v.Value);
          }
      }
      dataGridViewMain.DataSource = DictionaryGeneralUsers.Values;
  }  
  </code></pre>
  
  <p>I binded the combo box in this way,   </p>
  
  <pre><code>cboRolesList.DataSource = new BindingSource(dictionaryRole, null);  
  cboRolesList.DisplayMember = "Value";  
  cboRolesList.ValueMember = "Key";
  </code></pre>