?
Solved

CheckBoxList Child controls

Posted on 2011-02-15
3
Medium Priority
?
1,436 Views
Last Modified: 2013-11-05
I have a checkboxlist populated by a datasource which creates a toplevel category and child elements like such
-Car
---Dodge
---Chevy
---Pontiac

How do I access the "selected" feature of the individual items? Before the datasource was adding a child list this worked

ListItem objListItem = CheckBoxList.Items.FindByValue("x");

if(objListItem != null)
{
objListItem.Selected = true;
}

This code used to work until the datasource gave me parent/child checkboxes
0
Comment
Question by:Akiren
  • 2
3 Comments
 
LVL 20

Accepted Solution

by:
informaniac earned 2000 total points
ID: 34904004
foreach(ListItem li in chkLst.Items){if(li.Value=="x") li.Selected = true;}
0
 
LVL 20

Expert Comment

by:informaniac
ID: 34904015
foreach(ListItem li in chkLst.Items){if(li.Value=="x") li.Selected = true;}
0
 
LVL 11

Expert Comment

by:SAMIR BHOGAYTA
ID: 34904625
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses
Course of the Month16 days, 7 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question