-
CheckBoxList select
Please can someone tell me how to add an item to a CheckBoxList and then select it?
Code:
<div class="seasonType">
Analysis Type<br />
<asp:CheckBoxList ID="cblAnalType" runat="server">
</asp:CheckBoxList>
</div>
Code:
DS = recall.getDistinctType()
dt = DS.Tables(0)
For Each dr In dt.Rows
cblAnalType.Items.Add(dr("RG_TYPE_VALUE").ToString)
If CBool(dr("RG_TYPE_SET")) Then
cblAnalType.SelectedValue = dr("RG_TYPE_VALUE").ToString
End If
Next
I have written this code but the RG_TYPE_SET is a boolean, so if it is true I want the tick boc to be selected.
When I run this it only ever selects the last item in the list! Can more than one item be selected?
thanks Paul
-
Re: CheckBoxList select
have a look at the checkedlistbox.setitemchecked method:
http://msdn.microsoft.com/en-us/libr...emchecked.aspx
-
Re: CheckBoxList select
Moved to the ASP.Net forum.