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>
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.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
When I run this it only ever selects the last item in the list! Can more than one item be selected?
thanks Paul


Reply With Quote


