This is a migrated thread and some comments may be shown as answers.

RadComboBox Checkbox problem

5 Answers 166 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
S L
Top achievements
Rank 1
S L asked on 28 Nov 2013, 06:58 AM
Why there was any error saying "CheckedItems is not a member of Telerik.WebControls.RadComboBox" ?
Why there was an error saying "Checked is not a member of Telerik.WebControls.RadComboBoxItem" ?

            Dim collection As IList(Of RadComboBoxItem) = rcb.CheckedItems
            Dim intCheck As Integer = collection.Count

            For Each itm As RadComboBoxItem In collection
                If itm.Value = drName(strColumn) And Not (drName(strColumn) Is DBNull.Value) Then
                    itm.Checked = True
                    Exit For
                End If
            Next

my development tools were VS2010 using IIS 6.5 ASP 2.0

5 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 28 Nov 2013, 11:35 AM
Hi S L,

Unfortunately I couldn't replicate the issue at my end. Please have a look into sample code to which works as expected.

ASPX:
<telerik:RadComboBox ID="RadComboBox1" CheckBoxes="true" runat="server">
    <Items>
        <telerik:RadComboBoxItem Text="Item1" runat="server" Value="1" />
        <telerik:RadComboBoxItem Text="Item2" runat="server" Value="1" />
        <telerik:RadComboBoxItem Text="Item3" runat="server" Value="1" />
        <telerik:RadComboBoxItem Text="Item4" runat="server" Value="1" />
        <telerik:RadComboBoxItem Text="Item5" runat="server" Value="2" />
        <telerik:RadComboBoxItem Text="Item6" runat="server" Value="2" />
        <telerik:RadComboBoxItem Text="Item7" runat="server" Value="2" />
        <telerik:RadComboBoxItem Text="Item8" runat="server" Value="2" />
    </Items>
</telerik:RadComboBox>
<telerik:RadButton ID="RadButton1" runat="server" Text="Get CheckedItems" OnClick="RadButton1_Click">
</telerik:RadButton>

C#:
Protected Sub RadButton1_Click(sender As Object, e As EventArgs)
    Dim collection As IList(Of RadComboBoxItem) = RadComboBox1.CheckedItems
    Dim intCheck As Integer = collection.Count
    For Each itm As RadComboBoxItem In collection
        If itm.Value = "1" Then
            itm.Checked = True
        Else
            itm.Checked = False
        End If
    Next
End Sub

Thanks,
Princy.
0
S L
Top achievements
Rank 1
answered on 29 Nov 2013, 01:59 AM
i try ur code and i still have error on codes.
RadComboBox1.CheckedItems, saying CheckedItems is not a member of RadComboBox
itm.Checked = False, saying Checked is not a member of RadComboBoxItem

i am using Telerik 2002-2011, Telerik.Web.UI.dll, version 2011.1.413.35.
i am wondering does this version not having checkbox in radcombobox.
0
Princy
Top achievements
Rank 2
answered on 29 Nov 2013, 03:07 AM
Hi S L,

RadComboBox introduces CheckBox support in Q2,2011 version. Please upgrade your telerik version to solve the issue.

Thanks,
Princy.
0
S L
Top achievements
Rank 1
answered on 29 Nov 2013, 04:12 AM
Thanks. Can I know where I can download this Q2,2011 version setup?
0
Shinu
Top achievements
Rank 2
answered on 30 Nov 2013, 02:22 AM
Hi S L,

Please have a look into this documentation to update the version.

Thanks,
Shinu.
Tags
ComboBox
Asked by
S L
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
S L
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Share this question
or