
Jonathan Torres
Top achievements
Rank 1
Jonathan Torres
asked on 08 Jul 2010, 12:12 AM
I am transferring the contents of one radlistbox to another using javascript:
item.set_text(doc10.get_text());
item.set_value(doc10.get_text());
listBox.get_items().add(item);
After I have added all the items, the following statement will return the # of items in the listbox: listBox.get_items()._array.length
After this, I submit my page and I'm trying to access the contents of the listbox in the codebehind, but RadListbox.Items.Count returns 0.
Can anyone explain why this is happening? I am using Q2 2009 RadListbox.
Thanks,
Jon
item.set_text(doc10.get_text());
item.set_value(doc10.get_text());
listBox.get_items().add(item);
After I have added all the items, the following statement will return the # of items in the listbox: listBox.get_items()._array.length
After this, I submit my page and I'm trying to access the contents of the listbox in the codebehind, but RadListbox.Items.Count returns 0.
Can anyone explain why this is happening? I am using Q2 2009 RadListbox.
Thanks,
Jon
5 Answers, 1 is accepted
0
Accepted
Hi Jon,
You should use trackChanges() and commitChanges() methods of the listbox in order to preserve the changes to the server. You can check this help article about this.
Best regards,
Yana
the Telerik team
You should use trackChanges() and commitChanges() methods of the listbox in order to preserve the changes to the server. You can check this help article about this.
Best regards,
Yana
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0

Jonathan Torres
Top achievements
Rank 1
answered on 08 Jul 2010, 04:32 PM
Thank you, that worked.
0

Hanso Gnana
Top achievements
Rank 1
answered on 17 Aug 2010, 01:34 AM
Hello,
In this thread, Jon said "After I have added all the items, the following statement will return the # of items in the listbox: listBox.get_items()._array.length".
It worked for me too. But could someone please comment on where in the documentation its mentioned that this is the way to access the count of a collection. I spent some time looking for it and did not find it anywhere - only when I came across this thread (kudos to this forum).
Thanks!
In this thread, Jon said "After I have added all the items, the following statement will return the # of items in the listbox: listBox.get_items()._array.length".
It worked for me too. But could someone please comment on where in the documentation its mentioned that this is the way to access the count of a collection. I spent some time looking for it and did not find it anywhere - only when I came across this thread (kudos to this forum).
Thanks!
0
Hello Hanso,
Actually _array is a private property, that's why it's not mentioned in the documentation, the correct way is to use get_count() method of the items collection as shown here.
Best regards,
Yana
the Telerik team
Actually _array is a private property, that's why it's not mentioned in the documentation, the correct way is to use get_count() method of the items collection as shown here.
Best regards,
Yana
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0

Hanso Gnana
Top achievements
Rank 1
answered on 18 Aug 2010, 01:29 AM
Many thanks.