Monday, August 13, 2012

How to Uncheck CheckBoxList on Cancle button in C#.net

protected void btnCancel_Click(object sender, EventArgs e)
{          
   UncheckCheckBoxList();
}

public void UncheckCheckBoxList()
{
      Int32 Index = chkListDependents.SelectedIndex;
      while (Index != -1)
      {
           chkListDependents.Items[Index].Selected = false;
           Index = chkListDependents.SelectedIndex;
       }
}

No comments: