Link to home
Start Free TrialLog in
Avatar of Ashwin_shastry
Ashwin_shastry

asked on

Checking CheckBoxes in CheckBoxList

Hello guys,

I have a Check Box list like the follwoing

<asp:CheckBoxList id="ChkList_CoBrand1" runat="server" Width="117px" RepeatDirection="Vertical">
<asp:ListItem Value="Community Info">Community Info</asp:ListItem>
<asp:ListItem Value="Crime">Crime</asp:ListItem>
<asp:ListItem Value="Sal Analyser">Sal Analyser</asp:ListItem>
</asp:CheckBoxList>

My task is pretty simple on page load I retrieve from the database for each corresponding Listitem a bool value depending on the bool value returned (In this example say I will return true,true,false)I will need to check the items on which are true and not check items which are false .

How would i go about doing this???

I tried to use  ChkList_CoBrand1.Items[0].Selected = "true/false"
but that doesnot work..

How would i check/uncheck the Listitems in a CheckBoxList ?

Hoping for some help

Ashwin
ASKER CERTIFIED SOLUTION
Avatar of Carl Tawn
Carl Tawn
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial