or
if
(radListBox.SelectedIndex <= -1)
{
radListBox.SelectedIndex = 0;
}
else
{
radListBox.SelectedIndex++;
}
System.NullReferenceException |
bei Telerik.Windows.Controls.GridView.GridViewDataControl.Move(FocusNavigationDirection navigationDirection) |
bei Telerik.Windows.Controls.GridView.GridViewDataControl.ExecuteMoveCommands(FocusNavigationDirection direction) |
bei Telerik.Windows.Controls.GridView.GridViewDataControl.MoveNext() |
bei Telerik.Windows.Controls.GridView.GridViewDataControl.OnMoveNextCommand(Object sender, ExecutedRoutedEventArgs e) |
bei System.Windows.Input.CommandBinding.OnExecuted(Object sender, ExecutedRoutedEventArgs e) |
Property
ProductosTotal
As
New
CollectionViewSource
Property
ProductosPedido
As
New
ObservableCollection(Of Productos)
'Called when initializing view
Private
Sub
LoadProductosTotal()
Dim
prods = operacionesProductos.GetAllProductos()
If
prods IsNot
Nothing
Then
ProductosTotal =
New
CollectionViewSource
ProductosTotal.Source = prods
End
If
End
Sub
<!--Style-->
<
Style
x:Key
=
"DraggableListBoxItem"
TargetType
=
"telerik:RadListBoxItem"
>
<
Setter
Property
=
"telerik:DragDropManager.AllowCapturedDrag"
Value
=
"True"
/>
</
Style
>
<!--SOURCE RADLISTBOX-->
<
telerik:RadListBox
Grid.Column
=
"0"
ItemContainerStyle
=
"{StaticResource DraggableListBoxItem}"
ItemsSource
=
"{Binding ProductosTotal.View}"
ItemTemplate
=
"{StaticResource ListBoxItemTemplate}"
>
<
telerik:RadListBox.GroupStyle
>
<
GroupStyle
>
<
GroupStyle.HeaderTemplate
>
<
DataTemplate
>
<
StackPanel
Height
=
"Auto"
Background
=
"{telerik:Windows8Resource ResourceKey=AccentBrush}"
Margin
=
"0 5 0 5"
>
<
TextBlock
Text
=
"{Binding Name}"
FontFamily
=
"Segoe UI Light"
FontWeight
=
"Bold"
FontSize
=
"16"
Margin
=
"10 3 0 0"
Foreground
=
"{telerik:Windows8Resource ResourceKey=MainBrush}"
/>
</
StackPanel
>
</
DataTemplate
>
</
GroupStyle.HeaderTemplate
>
</
GroupStyle
>
</
telerik:RadListBox.GroupStyle
>
<
telerik:RadListBox.DragDropBehavior
>
<
Behaviors:ListBoxDragDropBehaviorCopy
/>
</
telerik:RadListBox.DragDropBehavior
>
<
telerik:RadListBox.DragVisualProvider
>
<
telerik:ScreenshotDragVisualProvider
/>
</
telerik:RadListBox.DragVisualProvider
>
</
telerik:RadListBox
>
<!--DESTINATION RADLISTBOX-->
<
telerik:RadListBox
Grid.Row
=
"1"
ItemsSource
=
"{Binding ProductosPedido}"
AllowDrop
=
"True"
ItemTemplate
=
"{StaticResource ListBoxItemTemplate}"
>
<
telerik:RadListBox.DragDropBehavior
>
<
telerik:ListBoxDragDropBehavior
/>
</
telerik:RadListBox.DragDropBehavior
>
</
telerik:RadListBox
>
ListBoxDragDropBehavior
to supress the remove operation because it threw an exception.