When selecting an Item and performing a PostBack, the selected item's value is not accessible once the page reloads.
A "Control 'RadMultiSelect1' referenced by the ControlToValidate property of 'MultiSelectValidator1' cannot be validated" error is thrown when the RadMultiSelect id is passed to the ControlToValidate property of the RequiredFieldValidator or CustomValidator.
<telerik:RadMultiSelect ID="RadMultiSelect1" runat="server" DataTextField="text" DataValueField="value">
<Items>
<telerik:MultiSelectItem Text="Item 1" Value="1"></telerik:MultiSelectItem>
<telerik:MultiSelectItem Text="Item 2" Value="2"></telerik:MultiSelectItem>
<telerik:MultiSelectItem Text="Item 3" Value="3"></telerik:MultiSelectItem>
</Items>
</telerik:RadMultiSelect>
<telerik:RadButton runat="server" ID="RadButton1" Text="Postback" AutoPostBack="true" />
<asp:CustomValidator ErrorMessage="Please select an item" ClientValidationFunction="ClientValidationFunction" runat="server" />
<script>
function ClientValidationFunction(sender, args) {
var multiselect = $find("<%= RadMultiSelect1.ClientID %>");
if (multiselect.get_value().length == 0) {
args.IsValid = false;
}
}
</script>
RadMultiselect control has ClearButton property which should enable displaying the button for clearing all the selected options...
However, eventhough I have this property turned on I don't see any button for clearing the values... I can only go to the "expected" position for the button and then my mouse cursor is changed and after clicking all the values are cleared as expected...
<telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" RenderMode="Lightweight" DecoratedControls="All" />
<telerik:RadMultiSelect runat="server"
AutoClose="false"
Placeholder="Select attendees..."
DataTextField="text"
DataValueField="text"
Width="400px"
ID="RadMultiSelect2">
<Items>
<telerik:MultiSelectItem Text="Steven White"></telerik:MultiSelectItem>
<telerik:MultiSelectItem Text="Nancy King"></telerik:MultiSelectItem>
<telerik:MultiSelectItem Text="Nancy Davolio"></telerik:MultiSelectItem>
</Items>
</telerik:RadMultiSelect>
Scenario 1)
- Set MultiSelect1.Enabled=false;
- Do a postback;
Expected: MultiSelect remain disabled
Actual: MultiSelect gets enabled
Workaround: set MultiSelect1.Enable = false instead of .Enabled.
Scenario 2)
- Add a MultiSelect inside asp:Panel
- Disable the asp:Panel
Expected: MultiSelect is disabled
Actual: MultiSelect remains enabled
Scenario: Server paging and filtering are enabled for RadMultiSelect.
Currently, the Selected item is not displayed within the drop-down even if it is still selected in the control.
The expected behavior is to have all selected items in the dropdown even when they are not part of the currently filtered set of items.
The SelectionChanged event is fired before Page_Load, hence when the ViewState is applied, it overrides the changes made inside the OnSelectionChanged handler.
Example - Clearing the CheckBox selection of a RadComboBox inside SelectionChanged
Workaround - Create a custom boolean property on the page and set it to true inside the SelectionChanged. Then, in Page_Load or the OnLoad event of any control, execute your logic based on the custom boolean property value.
Hi,
I wanted to implement RadComboBox combined with checkboxes and load on demand approach.
However, this page explained it is not possible and advised to use RadMultiSelect with Virtualization
https://docs.telerik.com/devtools/aspnet-ajax/controls/combobox/functionality/checkbox-support
I checked the page and demo is explained via web service...
Is there a demo where it would be explained that when I type e.g. 3 characters some function would be called (e.g. OnItemsRequested) and in the server I would call database and fill the required data ? We don't have web service for providing the data... In code-behind we always access databases.
Thanks,
Peter
I am getting the following error when using RadMultiSelect with over 13000 records:
Error
InnerException Message: Error during serialization or deserialization
using the JSON JavaScriptSerializer. The length of the string exceeds
the value set on the maxJsonLength property.
Error InnerException
StackTrace: at
System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object
obj, StringBuilder output, SerializationFormat serializationFormat)
at Telerik.Web.UI.AdvancedJavaScriptSerializer.Serialize(Object obj)
at Telerik.Web.UI.RadMultiSelect.DescribeItems(IScriptDescriptor descriptor)
at Telerik.Web.UI.RadMultiSelect.DescribeComponent(IScriptDescriptor descriptor)
at Telerik.Web.UI.ScriptRegistrar.GetScriptDescriptors(Control control)
at Telerik.Web.UI.RadDataBoundControl.GetScriptDescriptors()
at System.Web.UI.ScriptControlManager.RegisterScriptDescriptors(IScriptControl scriptControl)
at Telerik.Web.UI.RadDataBoundControl.RegisterScriptDescriptors()
at Telerik.Web.UI.RadDataBoundControl.Render(HtmlTextWriter writer)
at Telerik.Web.UI.RadMultiSelect.Render(HtmlTextWriter writer)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
I already have <jsonSerialization maxJsonLength="2147483647"> in my web.config but still errors out.
Telerik.Web.UI Version: 2022.2.622.45
Seems similar to this issue: https://www.telerik.com/forums/maxjsonlength-exceeded-in-radmap
But updating to higher version than 2020 didn't seem to solve it. Was the fix only for RadMap?
As it was for other
The MultiSelect component does not load its styles if it was set to Visible="False" at initial load and made visible during a PostBack, thus breaking its appearance.
This problem happens in version 2024.4.1114.