<asp:CheckBoxList ID="CheckBoxList1" runat="server" AutoPostBack="true" SelectionMode="Multiple" AppendDataBoundItems="true" DataTextField="BranchName" DataValueField="Branchcode" OnSelectedIndexChanged="lst_SelectedIndexChanged_1">
<asp:ListItem Text="All" Value="0" />
</asp:CheckBoxList>
<asp:CheckBoxList ID="lstMain" runat="server" AutoPostBack="true" SelectionMode="Multiple" AppendDataBoundItems="true" DataTextField="BranchName" DataValueField="Branchcode" OnSelectedIndexChanged="lst_SelectedIndexChanged">
<asp:ListItem Text="1" Value="0" />
<asp:ListItem Text="2" Value="0" />
<asp:ListItem Text="3" Value="0" />
</asp:CheckBoxList>
protected void lst_SelectedIndexChanged_1(object sender, EventArgs e)
{
if (CheckBoxList1.Items[0].Selected == true)
{
foreach (ListItem ls in lstMain.Items)
{
ls.Selected = true;
}
}
else
{
foreach (ListItem ls in lstMain.Items)
{
ls.Selected = false;
}
}
}