Edit this page

Reordering

The Reordering server event fires when the AutoPostBackOnReorder="True". It fires once for all selected items.

The event handler receives two parameters:

  1. The instance of the listbox firing the event

  2. 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:

protected void RadListBox1_Reordering(object sender, RadListBoxReorderingEventArgs e)
{
    if (e.Items.Count > 2)
        e.Cancel = true;
} 
Protected Sub RadListBox1_Reordering(ByVal sender As Object, ByVal e As RadListBoxReorderingEventArgs)
    If e.Items.Count > 2 Then
        e.Cancel = True
    End If
        End Sub 

See Also

Is this article helpful? No Yes
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy