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

RadComboBox with checkboxes

3 Answers 65 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Dhaval
Top achievements
Rank 1
Dhaval asked on 28 Aug 2012, 08:57 AM
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

3 Answers, 1 is accepted

Sort by
0
Ivana
Telerik team
answered on 28 Aug 2012, 03:00 PM
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.
0
Dhaval
Top achievements
Rank 1
answered on 28 Aug 2012, 03:19 PM

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

0
Ivana
Telerik team
answered on 30 Aug 2012, 11:01 AM
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.
Tags
ComboBox
Asked by
Dhaval
Top achievements
Rank 1
Answers by
Ivana
Telerik team
Dhaval
Top achievements
Rank 1
Share this question
or