title: allow only one checkbox to be checked - asp.net c#
body: <p>I have a gridview where i have added checkboxes programmatically.
  i do as following when creating checkboxes inside a foreach loop, so that they trigger an event when checked,</p>
  
  <pre><code>            cbGV = new CheckBox();
              cbGV.ID = "cbGV";
              cbGV.AutoPostBack = true;
              cbGV.CheckedChanged += new EventHandler(this.cbGV_CheckedChanged);
  </code></pre>
  
  <p>So basically when i want the event to be triggered, i have the following below,</p>
  
  <pre><code>    protected void cbGV_CheckedChanged(object sender, EventArgs e)
      {
          //gets the current checked checkbox.
          CheckBox activeCheckBox = sender as CheckBox;
  
          foreach (GridViewRow gvr in GridView1.Rows)
          {
              //this code is for finding the checkboxes in the gridview.
  
              CheckBox checkBox = ((CheckBox)gvr.FindControl("cbGV"));
  
              //so basically, right here i'm confused on how i should compare the if/else logic, how i should compare and disable every other checkbox if the current checkbox is checked. Any ideas gues?
  
          }
  </code></pre>
  
  <p>thanks for your answer in advance.</p>