So, I have scoured the NET and the ListBox release notes and cannot find anyone else having this problem so I am hoping this will be an easy fix by a Telerik Guru. I am using,
- Telerik UI for ASP.NET AJAX ver. 2014.3.1209.45
- browser: Chrome
Behavior: Upon initial load, I write values from the server side to the new control. Upon checking or unchecking, my JavaScript function fires, but the ListBox's get_checkedItems() method returns the items that are checked "before" the "OnClientItemChecking" event fires. I would expect to get the items of the ListBox after I check or uncheck items, in other words, the current state of the ListBox. Anyone have any ideas?
<
telerik:RadListBox
ID
=
"CMListBox"
runat
=
"server"
RenderMode
=
"Lightweight"
SelectionMode
=
"Multiple"
CheckBoxes
=
"true"
Width
=
"300px"
OnClientItemChecking
=
"CMListBox_ItemChecking"
Height
=
"100px"
> <
Items
></
Items
></
telerik:RadListBox
>
function
CMListBox_ItemChecking(sender,args)
{
var
Radlb = $find(
"<%= CMListBox.ClientID %>"
);
var
txt =
""
;
var
labelStr =
""
;
var
iter = Radlb.get_checkedItems().length;
for
(
var
i = 0; i < iter ; i++)
{
txt = Radlb.get_checkedItems()[i].get_text();
labelStr += txt +
"<br>"
;
}
if
(labelStr !=
""
)
{ labelStr = labelStr.substring(0, labelStr.length - 4);
}
else
{
labelStr =
"None"
;
}
var
s = document.getElementById(
"CommManagerID"
);
s.innerHTML = labelStr;
}