I have a RadListBox with an overrided ItemTemplate that uses a RadComboBox as one of its elements. When the combo box's scroll bar is visible, attempting to scroll triggers the drag process in the RadListBox. When I disable drag and drop completely, I am not able to scroll - it appears that the relevant mouse events are being captured by the RadListBox.
Here is the code for the listbox:
Here is the code for the item template:
I've tried tracking when a combobox is expanded so that I can disable drag/drop at that time, but there seems to be no way to do that effectively. What is the correct way to handle this issue?
Here is the code for the listbox:
<telerik:RadListBox Name="rlbSpices" QueryContinueDrag="rlbSpices_QueryContinueDrag" telerik:DragDropManager.AllowDrag="True" AllowDrop="True" ScrollViewer.HorizontalScrollBarVisibility="Disabled" Grid.Row="1" Grid.Column="1" Margin="5" ItemsSource="{Binding RecipeSpices, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ItemTemplate="{StaticResource SpiceItemTemplate}"> <telerik:RadListBox.DragVisualProvider> <telerik:ScreenshotDragVisualProvider /> </telerik:RadListBox.DragVisualProvider> <telerik:RadListBox.DragDropBehavior> <telerik:ListBoxDragDropBehavior AllowReorder="True" /> </telerik:RadListBox.DragDropBehavior></telerik:RadListBox>
Here is the code for the item template:
<DataTemplate x:Key="SpiceItemTemplate"> <Grid HorizontalAlignment="Stretch"> <Grid.ColumnDefinitions> <ColumnDefinition Width="100"/> <ColumnDefinition Width="50"/> <ColumnDefinition Width="30"/> <ColumnDefinition Width="25"/> </Grid.ColumnDefinitions> <local:IngredientCombobox Loaded="IngredientCombobox_Loaded" PreviewMouseMove="IngredientCombobox_PreviewMouseMove" MouseMove="IngredientCombobox_MouseMove" DropDownOpened="IngredientCombobox_DropDownOpened" DropDownClosed="IngredientCombobox_DropDownClosed" Height="20" VerticalAlignment="Top" Grid.Column="0" SelectedItem="{Binding Spice}"/> <xctk:DoubleUpDown Grid.Column="1" Height="20" Width="50" Margin="0,0,0,0" VerticalAlignment="Top" FormatString="F2" Value="{Binding Amount}" Increment=".01" Maximum="1000.00" /> <TextBlock Grid.Column="2" Margin="5,0,0,0" Text="{Binding Unit.Name}"/> <Button Grid.Column="3" Width="25" Height="25" Name="btnRecipeSpiceDelete" Click="btnRecipeSpiceDelete_Click">X</Button> </Grid></DataTemplate>I've tried tracking when a combobox is expanded so that I can disable drag/drop at that time, but there seems to be no way to do that effectively. What is the correct way to handle this issue?