내 Excel AddIn에서 WPF 창이 있습니다. 윈도우 안에는 상단 부분에 DataGrid (DataGrid1이라고 함)가있는 usercontrol이 있습니다. 창의 아래 부분에는 DataGrid를 포함하는 또 다른 usercontrol이 있습니다 (DataGrid2라고 함). 나는 전혀 트리거되지 않습니다DataGrid (WPF)에서 드래그 앤 드롭이 작동하지 않습니다.
<toolkit:DataGrid
Style="{StaticResource DataGridStyle}"
SelectionMode="Extended"
ItemsSource="{Binding Relations}"
SelectedItem="{Binding ListSelection}"
MouseDoubleClick="dg_MouseDoubleClick"
DragEnter="DataGrid_CheckDropTarget"
DragLeave="DataGrid_CheckDropTarget"
DragOver="DataGrid_CheckDropTarget"
PreviewMouseLeftButtonDown="DG_PreviewMouseLeftButtonDown"
ContextMenuOpening="dg_ContextMenuOpening"
PreviewMouseMove="DG_MouseMove" BorderBrush="LightGray">
datagrid2
<dg:DataGrid Grid.Row="1" x:Name="basketDG" Margin="5 0 5 0" Background="White"
AutoGenerateColumns="False"
Style="{StaticResource DataGridStyle}"
ItemsSource="{Binding MyItems, Mode=OneWay}"
SelectedItem="{Binding SelectedRelComplete}"
SelectionChanged="BasketDgSelectionChanged"
Drop="DataGridDrop"
DragEnter="DataGridDragEnter"
>
<Style x:Key="DataGridRowStyle" TargetType="{x:Type dg:DataGridRow}">
<Setter Property="AllowDrop" Value="True" />
</Style>
<Style x:Key="DataGridStyle" TargetType="{x:Type dg:DataGrid}">
<Setter Property="RowStyle" Value="{StaticResource DataGridRowStyle}" />
</Style>
하지만 (datagrid2에) 행사의 dragEnter를 들어, DataGrid1이 행을 드래그 DataGrid1이에 대한 datagrid2
에 드롭하고 싶다.
무엇이 여기에 있습니까? 마지막으로, 인터넷 검색과 투쟁의 일 후