Completed
Last Updated: 28 Apr 2023 11:29 by ADMIN
ADMIN
Nencho
Created on: 22 May 2014 08:41
Category: ListBox
Type: Feature Request
1
ADD the ability to select multiple Items in RadListBox only with the mouse, when items exceed the visible area of the control

		
2 comments
ADMIN
Rumen
Posted on: 28 Apr 2023 11:29

Thanks to Shahram, we also have this knowledge base how-to article on the topic: 

Effortlessly Select Multiple Items Beyond Visible Area with Mouse

Best Regards,
Rumen
Progress Telerik

Heads up! Telerik UI for ASP.NET AJAX versions for .NET 3.5 and 4.0 are retired. Progress will continue shipping assemblies compatible with .NET 4.5 and later. See whether this affects your apps in this article.
Shahram
Posted on: 27 Apr 2023 16:08

Rumen provided the bellow code that successfully implements explained feature of the RadListBox:

 

<script language="javascript" type="text/javascript"> var $ = $telerik.$; function pageLoad(sender, args) { var listbox = $find("ID of RadListBox in question"); var listboxlement = $(listbox.get_element()).find(".rlbGroup")[0]; $(listbox.get_element()).find(".rlbList").on({ mousedown: function () { listbox.set_autoPostBack(false); }, mouseup: function () { listbox.set_autoPostBack(true); listbox.postback({ type: Telerik.Web.UI.ListBoxCommand.SelectedIndexChanged }); }, mousemove: function (e) { var offsetY = e.clientY - listboxElement.getBoundingClientRect().top; var scrollThreshold = 10; // Adjust this value as needed if (offsetY < scrollThreshold) { listboxElement.scrollTop -= scrollThreshold - offsetY; } else if (offsetY > listboxElement.clientHeight - scrollThreshold) { listboxElement.scrollTop += offsetY - (listboxElement.clientHeight - scrollThreshold); } } }); }

</script>