//hope you are looking for..
protected void chkboxmaritalstatus_SelectedIndexChanged(object sender, EventArgs e)
{
for(int i=0;i<chkboxmaritalstatus.items.count;i++)>
{
if (chkboxmaritalstatus.items[i].Selected && i>3)
{
rdomaritalstatusprefer.Checked = false;
rdomaritalstatusprefernot.Checked = true;
chkboxmaritalstatus.Enabled = false;
chkboxmaritalstatus.ClearSelection();
}
}
}
// if your requirement is only the above functionality check this snippet.
if (chkboxmaritalstatus.GetSelectedIndices().Count() > 3)
{
rdomaritalstatusprefer.Checked = false;
rdomaritalstatusprefernot.Checked = true;
chkboxmaritalstatus.Enabled = false;
chkboxmaritalstatus.ClearSelection();
}