Solved

CheckBoxList Child controls

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Technology Resume 7 67
how to remove duplicate code from my project 5 48
reading excel file in .net 2 31
Access is denied error from google drive api v2 in asp.net 1 44
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
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…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

756 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