Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 227535
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:36:24+00:00 2026-05-11T19:36:24+00:00

I have a checkboxlist wich contains a list of services loaded from a database

  • 0

I have a checkboxlist wich contains a list of services loaded from a database table. Each of these services can only be executed alone or with some other specific services. For example, if I select “Transfer Property” I cannot select “Register” at the same time.

I have a table which contains the relationships between Services and what Services can be selected together with each service (did I explained it right?).

What I need is to Click a service and then Disable/Disallow Checking of all the services that don’t are related to that service, and Re-enable that items when i Uncheck the parent item…

Is there a good way to do this? I mean, is there any way to do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T19:36:24+00:00Added an answer on May 11, 2026 at 7:36 pm

    First of all, your CheckBoxList will need to have AutoPostBack set to true.

    I believe the key to what youre looking for is

       CheckBoxList1.Items.FindByText(service).Enabled = false;
    

    or this works too

       CheckBoxList1.Items.FindByText(service).Attributes.Add("disabled", "disabled"); 
    

    in context, it could look something like this:

        <asp:CheckBoxList ID="CheckBoxList1" runat="server" AutoPostBack="True" 
            onselectedindexchanged="CheckBoxList1_SelectedIndexChanged">        
        </asp:CheckBoxList>
    
        protected void CheckBoxList1_SelectedIndexChanged(object sender, EventArgs e)
        {
    
            //first reset all to enabled
            for (int i = 0; i < CheckBoxList1.Items.Count; i++)
            {
                CheckBoxList1.Items[i].Attributes.Remove("disabled", "disabled");
            }
    
            for (int i = 0; i < CheckBoxList1.Items.Count; i++)
            {
    
                if (CheckBoxList1.Items[i].Selected)
                {
                    //get list of items to disable
                    string selectedService = CheckBoxList1.Items[i].Text;
                    List<string> servicesToDisable = getIncompatibleFor(selectedService);//this function is up to u
                    foreach (string service in servicesToDisable)
                    {
                        CheckBoxList1.Items.FindByText(service).Attributes.Add("disabled", "disabled");                                                
                    }                   
                }
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a CheckBoxList with a list of services that the user can execute...
I have a CheckBoxList where users can select multiple items from the list. I
I have a checkboxlist in C# that is databound from the database. What I
I have a CheckBoxList that displays a list of checkboxes using data from a
I have a checkboxlist.When I check one the value will appear in a table.Now
I have a page with several CheckBoxList controls with 4 checkboxes in each of
I have a Web User Control that contains a CheckBoxList. MyListControl: <asp:checkboxlist id=chkList runat=server>
I have the following ViewModel public class RecommendationModel { public List<CheckBoxItem> CheckBoxList { get;
I have Checkboxlist and i can't give it required field validator or custom validator.
I have a dynamic CheckBoxList that creates an HTML table. I've listed one row

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.