Hi
I use a RadComboBox with checkboxe that I hanle its event with javasript.
In server-side we need to set visibility of its items based on user search, then with javascript process them.
combo.get_items() :: in client-side return only those Items that are visible.
what should I do for it?
thanks.
I use a RadComboBox with checkboxe that I hanle its event with javasript.
In server-side we need to set visibility of its items based on user search, then with javascript process them.
combo.get_items() :: in client-side return only those Items that are visible.
what should I do for it?
thanks.
4 Answers, 1 is accepted
0
Hello Fatima,
You can try hiding a RadComboBoxItem by setting its Visible property to false.
Such item will not be included in RadComboBox items collection at client-side.
All the best,
Kalina
the Telerik team
You can try hiding a RadComboBoxItem by setting its Visible property to false.
Such item will not be included in RadComboBox items collection at client-side.
<
script
type
=
"text/javascript"
>
function OnClientLoad(sender) {
var itemsTexts="RadComboBox items are: ";
var items = sender.get_items();
for (i = 0; i <
items.get_count
(); i++)
{
itemsTexts += items.getItem(i).get_text() + ", ";
}
alert(itemsTexts);
}
</script>
<
telerik:RadComboBox
ID
=
"RadComboBox2"
runat
=
"server"
CheckBoxes
=
"true"
EnableCheckAllItemsCheckBox
=
"true"
OnClientLoad
=
"OnClientLoad"
AutoPostBack
=
"true"
>
<
Items
>
<
telerik:RadComboBoxItem
Text
=
"Arts"
/>
<
telerik:RadComboBoxItem
Text
=
"Biographies"
/>
<
telerik:RadComboBoxItem
Text
=
"Children's Books"
/>
<
telerik:RadComboBoxItem
Text
=
"Computers"
/>
</
Items
>
</
telerik:RadComboBox
>
All the best,
Kalina
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
0

Princy
Top achievements
Rank 2
answered on 24 Sep 2012, 09:20 AM
Hi Fatima,
When setting the Visible property to "false", the item is not rendered on page, and you will not able to access it from client side
One suggestion is that you can set the style display to false as follows.
C#:
CSS:
Thanks,
Princy.
When setting the Visible property to "false", the item is not rendered on page, and you will not able to access it from client side
One suggestion is that you can set the style display to false as follows.
C#:
RadComboBox1.Items.FirstOrDefault().CssClass =
"hidden"
;
CSS:
<style type=
"text/css"
>
.
hidden
{
display
:
none
!important
;
}
</style>
Thanks,
Princy.
0

Fatima
Top achievements
Rank 1
answered on 26 Sep 2012, 11:29 AM
Many thanks