Solved

CheckBoxList Child controls

Posted on 2011-02-15
3
1,397 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 500 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

708 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now