I have a radlistbox that's populated with all the employees in the company. The first 6-ish listings can be selected and the following button for inserting the entry will fire fine. But once something further down the list is selected the button no longer responds to clicks. RadListBox and RadButton markups are as follows:
<
telerik:RadListBox
ID
=
"ddlCSR"
runat
=
"server"
Width
=
"300"
Height
=
"100"
CheckBoxes
=
"true"
Skin
=
"Metro"
></
telerik:RadListBox
>
<
telerik:RadButton
ID
=
"cmdLogTime"
runat
=
"server"
Text
=
"Log Exception"
OnClick
=
"cmdLogTime_Click"
Skin
=
"Metro"
ValidationGroup
=
"DateRange"
>
<
Icon
SecondaryIconCssClass
=
"rbNext"
SecondaryIconRight
=
"4"
SecondaryIconTop
=
"2"
/>
</
telerik:RadButton
>
7 Answers, 1 is accepted
AJAX may sometimes hide both server and client-side errors. Therefore, when developing your app, we highly recommend you to ensure that the functionality works without adding AJAX. Please temporarily disable any AJAX on the page if present (RadAjaxManager, RadAjaxPanel, UpdatePanel, RadXmlHttpPanel, etc.) and enable your script debugger (FireBug or F12) to see whether there are any script or server errors interfering, and make sure that the application works without AJAX.
If this is not the case, you can create a very basic isolated sample including the RadListBox and RadButton definition demonstrating the problematic behavior and send it back to us for further investigation. This will enable us to replicate the issue locally and provide more precise suggestions.
Regards,
Eyup
Telerik by Progress
I've removed the AJAX from the page, and have gone through the events in debugging mode. The incorrect behavior remains, but when getting the incorrect behavior I now get an "Input string was not in correct format" error on page load. The thing is, the event never fired. Snippet of the code being fired when working below:
protected void cmdLogTime_Click(object sender, EventArgs e)
{
DateTime start = dtStart.SelectedDate.Value.Date;
DateTime end = dtEnd.SelectedDate.Value.Date;
if ((start != DateTime.Today) || (end != DateTime.Today))
{
string[] date = DateTime.Today.ToString().Split(' ');
lblMessage.Text = "Selected date must be today (" + date[0] + ") " + ddlCSR.CheckedItems[0].Text;
return;
}
}
Stepping through the code when an early entry is selected it fires fine and all the variables are correctly assigned and checked. Selecting the last entry triggers a postback but doesn't fire the event and gives the following error:
Server Error in '/' Application.
Input string was not in a correct format.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.FormatException: Input string was not in a correct format.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[FormatException: Input string was not in a correct format.]
System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +12526913
System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +120
System.ComponentModel.Int32Converter.FromString(String value, NumberFormatInfo formatInfo) +50
System.ComponentModel.BaseNumberConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value) +328
[Exception: 26661.599609375 is not a valid value for Int32.]
System.ComponentModel.BaseNumberConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value) +453
System.Web.Script.Serialization.ObjectConverter.ConvertObjectToTypeInternal(Object o, Type type, JavaScriptSerializer serializer, Boolean throwOnError, Object& convertedObject) +529
System.Web.Script.Serialization.ObjectConverter.ConvertObjectToTypeMain(Object o, Type type, JavaScriptSerializer serializer, Boolean throwOnError, Object& convertedObject) +141
System.Web.Script.Serialization.ObjectConverter.AssignToPropertyOrField(Object propertyValue, Object o, String memberName, JavaScriptSerializer serializer, Boolean throwOnError) +214
System.Web.Script.Serialization.ObjectConverter.ConvertDictionaryToObject(IDictionary`2 dictionary, Type type, JavaScriptSerializer serializer, Boolean throwOnError, Object& convertedObject) +1142
System.Web.Script.Serialization.ObjectConverter.ConvertObjectToTypeInternal(Object o, Type type, JavaScriptSerializer serializer, Boolean throwOnError, Object& convertedObject) +66
System.Web.Script.Serialization.ObjectConverter.ConvertObjectToTypeMain(Object o, Type type, JavaScriptSerializer serializer, Boolean throwOnError, Object& convertedObject) +141
System.Web.Script.Serialization.JavaScriptSerializer.Deserialize(JavaScriptSerializer serializer, String input, Type type, Int32 depthLimit) +60
System.Web.Script.Serialization.JavaScriptSerializer.Deserialize(String input) +70
Telerik.Web.UI.RadListBox.LoadPostData(String postDataKey, NameValueCollection postCollection) +150
Telerik.Web.UI.RadDataBoundControl.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection) +16
System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +758
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1833
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1586.0
The ListBox and Button markups remain as before, the Listbox is populated via code-behind from a SQL Database table with over 1000 entries and 52 columns including the ID. The query string for said population is as follows:
SELECT Id CId, LastName +', ' + FirstName + ' (' + CAST(Id AS VARCHAR(10)) + ')' C
FROM table
WHERE param = 1
ORDER BY LastName ASC
Any help would be greatly appreciated.
To assist you further, we will need to replicate and analyze the mentioned issue locally. Please open create a very basic isolated version of this scenario and open a formal support thread to send it back to us for further investigation.
Regards,
Eyup
Telerik by Progress
It turns out the Skin="Metro" portion of the RadListBox markup causes the bug. I'll work on building an isolated example site and send it via ticket.
I can't seem to reproduce the bug in a new project so some clarification:
The bug occurs in a site using Telerik references from 2013 and only when the RadListBox Skin is set to Metro. Removing the Skin setting from the HTML markup resolves the bug and everything works as it should. Hopefully this just means it's an old issue that's already been resolved.