Good day friends,
I got to know how we can make two checkboxes or checkboxes inside a checkbox list mutually exclusive. However my question is little different from that, Hope to get some help from stack overflow,
Well I have two checkbox lists, as follows and from a dataset table I am getting the check box values,
CheckBoxlist1 - Checkbox_selectColumns
if (IsDataSetNotEmpty(ds))
{
CheckBox_selectColumns.Items.Clear();
foreach (DataRow row in ds.Tables[0].Rows)
{
CheckBox_selectColumns.Items.Add(row[0].ToString());
}
}
CheckBoxlist2 - Checkbox_selectFields
if (IsDataSetNotEmpty(ds))
{
Checkbox_selectFields.Items.Clear();
foreach (DataRow row in ds.Tables[1].Rows)
{
CheckBox_selectColumns.Items.Add(row[0].ToString());
}
}
I will get following checkboxes in each lists.
Checkbox_selectColumns : Employee ID, First Name, Last Name
Checkbox_selectFields : manager ID, Manager FName, Manager LName
Is there any way , I can make these two checkboxes mutually exclusive, That is if I select any one or more checkbox from first list, I should not select any checkboxes from second list and vice versa..
Thank you...
SelectedIndex
property of each list - if the value of list 1 is >= 0, disable list 2, and vice versa. You'd also need to handle the situation where a selection was made in one list, and then the selection was cleared (i.e., you'd have to reenable the disabled list at that point). If I had more time I'd try to put together a code sample. Hopefully this will give you something to work with. – Solarism