RadComboBox with checkboxes

4 posts, 0 answers
  1. Dhaval
    Dhaval avatar
    11 posts
    Member since:
    Aug 2011

    Posted 28 Aug 2012 Link to this post

    Hi All,

    I am using a RadComboBox with checkboxes and I want to get its checked item on button click. For this I am using CheckedItems property of combo box.

    I am correctly getting the checked items if I use the combo box outside a RadGrid, but when I use the same combo box inside a RadGrid, I am not getting any checked items (count=0). I can correctly get the text of combo box, but cannot understand what is problem with getting the checked items.

    Please help!!! Thanks in advance...

    Dhaval
  2. Ivana
    Admin
    Ivana avatar
    657 posts

    Posted 28 Aug 2012 Link to this post

    Hello Dhaval,

    I have just tested the described scenario, RadComboBox nested inside RadGrid edit item template, but everything seems to work just as expected. Could you clarify a little bin more on your scenario? How do you exactly access the RadComboBox? Can you paste the code involved in here?

    All the best,
    Ivana
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. Dhaval
    Dhaval avatar
    11 posts
    Member since:
    Aug 2011

    Posted 28 Aug 2012 Link to this post

    Hi Ivana,

    Thanks for your reply.

    Below is my code in aspx:

    <ItemTemplate>
     <telerik:RadComboBox ID="rcbServiceTypeEdit" runat="server" EmptyMessage="Select a Service Type"
        EnableCheckAllItemsCheckBox="true" CheckedItemsTexts="DisplayAllInInput" CheckBoxes="true"
        OnClientItemChecked="CheckBoxtItemChecked">
       <Localization AllItemsCheckedString="All Service Types" CheckAllString="All Service Types" />
    </telerik:RadComboBox>
    </ItemTemplate>

    And below is my code in cs file:

    protected void btnEdit_Click(object sender, EventArgs e)
    {
      foreach (GridDataItem item in rgdHolidays.Items)
      {
         if (item.Selected)
         {
            RadComboBox rcbServiceType = (RadComboBox) item.FindControl("rcbServiceTypeEdit");
            var checkedItems = rcbServiceType.CheckedItems;
         }
      }
    }

    So, in above case I am not able to get the CheckedItems of combo box but able to get the Text.

    Dhaval

  4. Ivana
    Admin
    Ivana avatar
    657 posts

    Posted 30 Aug 2012 Link to this post

    Hello Dhaval,

    I have tested the described scenario, but I am still unable to replicate any issue. If the right instance of RadComboBox is found, the CheckedItems collection returns the correct items being checked.
    Could you please make sure that you have the right instance of RadComboBox?

    If the trouble continue, could you open a support ticket on the matter and send us a runnable sample project illustrating the problem?

    Regards,
    Ivana
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top