8 Answers, 1 is accepted
0
0
Dona
Top achievements
Rank 1
answered on 18 Jul 2013, 09:36 AM
Not working. I am getting Count=3 on debugging. I want to access all those values of items.
0
Princy
Top achievements
Rank 2
answered on 18 Jul 2013, 09:44 AM
Hi Dona,
Please try the following C# code.
C#:
Thanks,
Princy.
Please try the following C# code.
C#:
foreach
(RadComboBoxItem checkeditem
in
RadComboBox1.CheckedItems)
{
string
_value = checkeditem.Value;
//looping through each checked item and accessing its value.
}
Thanks,
Princy.
0
Rajeeve
Top achievements
Rank 1
answered on 11 Aug 2016, 10:37 AM
to get the checked combobox values in telerik (using javascript)
var checkeditems;
var combo = $find("<%= telerikcomboboxname.ClientID%>")
var items = combo.get_checkedItems();
for (i = 0; i < items.length; i++) {
if (i == 0) {
radvalue = Number(parseInt(items[i]._properties._data.value));
checkeditems=checkeditems+radvalue ;
}
else {
radvalue = Number(parseInt(items[i]._properties._data.value));
checkeditems= checkeditems+ "," + radvalue;
}
}
alert(Expenseitems);
this will work
thanks all
0
Hi Rajeeve,
Thank you for the suggested solution.
Note that this topic is on accessing checked items in the code-behind (C# / VB), while your suggestion is a client-side solution.
Note also that you won't need to use private properties (_properties and _data) of the RadComboBoxItem object to access the values of the item. You could freely use instead the get_value() method from the exposed client-side API of the object.
Moreover, if you do not initially set an empty string as a value of the checkeditems variable, it will produce the final result to have an "undefined" as prefix. In your suggestion, you also alert the wrong variable (Expenseitems), while the values are held in the checkeditems.
Modified working version of your sample code would be:
Regards,
Veselin Tsvetanov
Telerik by Progress
Thank you for the suggested solution.
Note that this topic is on accessing checked items in the code-behind (C# / VB), while your suggestion is a client-side solution.
Note also that you won't need to use private properties (_properties and _data) of the RadComboBoxItem object to access the values of the item. You could freely use instead the get_value() method from the exposed client-side API of the object.
Moreover, if you do not initially set an empty string as a value of the checkeditems variable, it will produce the final result to have an "undefined" as prefix. In your suggestion, you also alert the wrong variable (Expenseitems), while the values are held in the checkeditems.
Modified working version of your sample code would be:
var
checkeditems =
''
;
var
radvalue;
var
combo = $find(
"<%= RadComboBox1.ClientID%>"
)
var
items = combo.get_checkedItems();
for
(i = 0; i < items.length; i++) {
radvalue = items[i].get_value();
if
(i == 0) {
checkeditems = checkeditems + radvalue;
}
else
{
checkeditems = checkeditems +
","
+ radvalue;
}
}
alert(checkeditems);
Regards,
Veselin Tsvetanov
Telerik by Progress
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
0
Rajeeve
Top achievements
Rank 1
answered on 16 Aug 2016, 07:33 AM
yaaa you are right
0
jamsheer
Top achievements
Rank 1
Veteran
answered on 25 Apr 2017, 06:36 AM
Hi Veselin Tsvetanov,
Here I am using a RadCheckedDropDownList for multi select value. Where I want all checked values of RadCheckedDropDownList to the datatable.
Please Refer how could I add to the datatable the checked values from the checked list of RadCheckedDropDownList.
I need Like this : ' if(Checkeddrpdwnlist1.checked==true) ' then the value to datatable.
Thanks
Jamsheer
Here I am using a RadCheckedDropDownList for multi select value. Where I want all checked values of RadCheckedDropDownList to the datatable.
Please Refer how could I add to the datatable the checked values from the checked list of RadCheckedDropDownList.
I need Like this : ' if(Checkeddrpdwnlist1.checked==true) ' then the value to datatable.
Thanks
Jamsheer
0
jamsheer
Top achievements
Rank 1
Veteran
answered on 26 Apr 2017, 04:43 AM
Hi Veselin Tsvetanov,
Looking for your answer ,Hope you got my question.
Thanks
Jamsheer
Looking for your answer ,Hope you got my question.
Thanks
Jamsheer