Click here to Skip to main content
15,890,579 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
SQL
<asp:CheckBoxList ID="main_check" runat="server" AppendDataBoundItems="true"
                                RepeatColumns="5" RepeatDirection="Horizontal" AutoPostBack="true"
                                onselectedindexchanged="main_check_SelectedIndexChanged" />

VB
<asp:CheckBoxList ID="sub_check" runat="server" AppendDataBoundItems="true"
                                RepeatColumns="10" RepeatDirection="Horizontal" />



C#
protected void main_check_SelectedIndexChanged(object sender, EventArgs e)
    {

        foreach (ListItem li in main_check.Items)
        {
            if (li.Selected)
            {
                sbp.busines_id = Convert.ToInt16(li.Value);
            }
        }
        sbp.tag = 3;   
            sub_check.DataSource = sbb.sub_busines_bind(sbp);
            sub_check.DataTextField = "category_name";
            sub_check.DataValueField = "sub_busines_id";
            sub_check.DataBind();
}
Posted
Comments
aarif moh shaikh 9-Jun-15 3:28am    
Give DataSource after DataTextField and DataValueField ...
Ashish Darji 9-Jun-15 4:27am    
nothing change.please help me.
[no name] 9-Jun-15 10:58am    
Do you want to assign same selected items from main_check to sub_check list control. Or are you populating sub_check based on selection of main_check list?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900