New to Telerik UI for ASP.NET AJAX? Start a free 30-day trial
Reordering
The Reordering server event fires when the AutoPostBackOnReorder="True". It fires once for all selected items.
The event handler receives two parameters:
-
The instance of the listbox firing the event
-
An event arguments parameter containing the following properties:
-
Items - collection of RadListBoxItem objects which were selected for reordering.
-
Offset - returns -1 if you are moving the item up and 1 if you are moving the item down.
-
Cancel - set it to True to cancel the event and prevent the reordering to happen
The following example shows how to cancel the event if there are more than 2 items to be reordered:
C#
protected void RadListBox1_Reordering(object sender, RadListBoxReorderingEventArgs e)
{
if (e.Items.Count > 2)
e.Cancel = true;
}