Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drag and Drop on GridView fails in desktop application with WinUI Xaml Islands #3871

Closed
smk2007 opened this issue Dec 30, 2020 · 3 comments
Closed
Labels
appModel-win32 Exclusive to WinUI 3 Win32 Desktop apps product-winui3 WinUI 3 issues team-Controls Issue for the Controls team

Comments

@smk2007
Copy link
Member

smk2007 commented Dec 30, 2020

Describe the bug
Cannot use Drag and Drop in GridView.

Steps to reproduce the bug
Build a XAML UserControl and embed into a native Desktop application.
Add a GridView and enable drag and drop functionality:

    <GridView x:Name="test_grid" Width="300" Height="90" **CanReorderItems="True" AllowDrop="True" CanDrag="True"**>
        <GridView.ItemTemplate>
            <DataTemplate x:DataType="local:debug_chrome_grid_item">
                <Grid Background="{x:Bind Color, Mode=OneWay}" Width="30" Height="30">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="30"/>
                    </Grid.ColumnDefinitions>
                    <TextBlock Text="{x:Bind name, Mode=OneWay}" Foreground="Red" FontSize="14" Grid.Column="0" VerticalAlignment="Center"/>
                </Grid>
            </DataTemplate>
        </GridView.ItemTemplate>
    </GridView>

Run the program, and you will see the GridView. Then attempt to drag and drop.

Expected: No Error.

Actual:
[Inline Frame] Microsoft.UI.Xaml.dll!DirectUI::DXamlCore::EnsureDragDrop() Line 996
at E:\BA\57\s\dxaml\xcp\dxaml\lib\DXamlCore.cpp(996)
[Inline Frame] Microsoft.UI.Xaml.dll!DirectUI::DXamlCore::GetDragDrop() Line 368
at E:\BA\57\s\dxaml\xcp\dxaml\lib\DXamlCore.h(368)
Microsoft.UI.Xaml.dll!DirectUI::ListViewBase::OnDragGesture::__l118::(ABI::Windows::Foundation::IAsyncOperation * pAsyncOp, ABI::Windows::Foundation::AsyncStatus status) Line 176
at E:\BA\57\s\dxaml\xcp\dxaml\lib\ListViewBase_Partial_Reorder.cpp(176)
Microsoft.UI.Xaml.dll!Microsoft::WRL::AsyncBase<ABI::Windows::Foundation::IAsyncOperationCompletedHandler,Microsoft::WRL::Details::Nil,1,Microsoft::WRL::AsyncOptions<2,0,&GUID_NULL,0>>::FireCompletion() Line 769
at E:\BA\57\s\packages\Microsoft.Windows.SDK.cpp.10.0.18362.2004-preview\c\Include\10.0.18362.0\winrt\wrl\async.h(769)
Microsoft.UI.Xaml.dll!DirectUI::StartDragAsyncOperation::StartIfNeededImpl::__l5::(ABI::Windows::Foundation::IAsyncOperation * asyncOp, ABI::Windows::Foundation::AsyncStatus status) Line 134
at E:\BA\57\s\dxaml\xcp\dxaml\lib\StartDragAsyncOperation.cpp(134)
rpcrt4.dll!Invoke�()
rpcrt4.dll!NdrStubCall2()
rpcrt4.dll!NdrStubCall3()
combase.dll!CStdStubBuffer_Invoke(IRpcStubBuffer * This, tagRPCOLEMESSAGE * prpcmsg, IRpcChannelBuffer * pRpcChannelBuffer) Line 1458
at onecore\com\combase\ndr\ndrole\stub.cxx(1458)
rpcrt4.dll!CStdStubBuffer_Invoke()
[Inline Frame] combase.dll!InvokeStubWithExceptionPolicyAndTracing::__l6::<lambda_c9f3956a20c9da92a64affc24fdd69ec>::operator()() Line 1279
at onecore\com\combase\dcomrem\channelb.cxx(1279)
combase.dll!ObjectMethodExceptionHandlingAction<<lambda_c9f3956a20c9da92a64affc24fdd69ec>>(InvokeStubWithExceptionPolicyAndTracing::__l6::<lambda_c9f3956a20c9da92a64affc24fdd69ec> action, ObjectMethodExceptionHandlingInfo * pExceptionHandlingInfo, ExceptionHandlingResult * pExceptionHandlingResult, void *) Line 87
at onecore\com\combase\dcomrem\excepn.hxx(87)
[Inline Frame] combase.dll!InvokeStubWithExceptionPolicyAndTracing(IRpcStubBuffer * pMsg, tagRPCOLEMESSAGE *) Line 1277
at onecore\com\combase\dcomrem\channelb.cxx(1277)
combase.dll!DefaultStubInvoke(bool bIsAsyncBeginMethod, IServerCall * pServerCall, IRpcChannelBuffer * pChannel, IRpcStubBuffer * pStub, unsigned long * pdwFault) Line 1346
at onecore\com\combase\dcomrem\channelb.cxx(1346)
[Inline Frame] combase.dll!SyncStubCall::Invoke(IServerCall *) Line 1403
at onecore\com\combase\dcomrem\channelb.cxx(1403)
combase.dll!SyncServerCall::StubInvoke(IRpcChannelBuffer * pChannel, IRpcStubBuffer * pStub, unsigned long * pdwFault) Line 781
at onecore\com\combase\dcomrem\ServerCall.hpp(781)
[Inline Frame] combase.dll!StubInvoke(tagRPCOLEMESSAGE * pMsg, CStdIdentity * pStdID, IRpcStubBuffer *) Line 1628
at onecore\com\combase\dcomrem\channelb.cxx(1628)
combase.dll!ServerCall::ContextInvoke(tagRPCOLEMESSAGE * pMessage, IRpcStubBuffer * pStub, CServerChannel * pChannel, tagIPIDEntry * pIPIDEntry, unsigned long * pdwFault) Line 1423
at onecore\com\combase\dcomrem\ctxchnl.cxx(1423)
[Inline Frame] combase.dll!CServerChannel::ContextInvoke(tagRPCOLEMESSAGE *) Line 1332
at onecore\com\combase\dcomrem\ctxchnl.cxx(1332)
combase.dll!DefaultInvokeInApartment(tagRPCOLEMESSAGE * pMsg, unsigned long CallCatIn, bool bIsTouchedASTACall, IRpcStubBuffer * pStub, CServerChannel * pChnl, tagIPIDEntry * pIPIDEntry, unsigned long * pdwFault) Line 3299
at onecore\com\combase\dcomrem\callctrl.cxx(3299)
[Inline Frame] combase.dll!AppInvoke(ServerCall * pStub, CServerChannel *) Line 1122
at onecore\com\combase\dcomrem\channelb.cxx(1122)
combase.dll!ComInvokeWithLockAndIPID(ServerCall * pServerCall, tagIPIDEntry * pIPIDEntry, bool * pbCallerResponsibleForRequestMessageCleanup) Line 2210
at onecore\com\combase\dcomrem\channelb.cxx(2210)
combase.dll!ThreadInvokeWorker(_RPC_MESSAGE * pMessage) Line 7016
at onecore\com\combase\dcomrem\channelb.cxx(7016)
combase.dll!ThreadInvoke(_RPC_MESSAGE * message) Line 7152
at onecore\com\combase\dcomrem\channelb.cxx(7152)
rpcrt4.dll!DispatchToStubInCNoAvrf�()
rpcrt4.dll!RPC_INTERFACE::DispatchToStubWorker()
rpcrt4.dll!RPC_INTERFACE::DispatchToStubWithObject()
rpcrt4.dll!LRPC_SCALL::DispatchRequest()
rpcrt4.dll!LRPC_SCALL::HandleRequest(struct _PORT_MESSAGE *,struct _PORT_MESSAGE *,void *,unsigned __int64,class RPCP_ALPC_HANDLE_ATTR *)
rpcrt4.dll!LRPC_ADDRESS::HandleRequest()
rpcrt4.dll!LRPC_ADDRESS::ProcessIO(void *)
rpcrt4.dll!LrpcIoComplete()
ntdll.dll!TppAlpcpExecuteCallback()
ntdll.dll!TppWorkerThread()
kernel32.dll!BaseThreadInitThunk�()
ntdll.dll!RtlUserThreadStart�()

Expected behavior
Drag and Drop works on GridView.

Screenshots

image

Version Info
Microsoft.WinUI.3.0.0-preview2.200713.0
Windows 10 Version: 19041

NuGet package version:
Microsoft.WinUI.3.0.0-preview2.200713.0

Windows app type:

UWP Win32
Yes
Windows 10 version Saw the problem?
Insider Build (xxxxx)
May 2020 Update (19041) Yes
November 2019 Update (18363)
May 2019 Update (18362)
October 2018 Update (17763)
April 2018 Update (17134)
Fall Creators Update (16299)
Creators Update (15063)
Device form factor Saw the problem?
Desktop Yes
Xbox
Surface Hub
IoT

Additional context

@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Dec 30, 2020
@smk2007
Copy link
Member Author

smk2007 commented Dec 30, 2020

Same issue with simpler XAML that works fine on UWP:

    <GridView MaxHeight="310" AllowDrop="True" CanReorderItems="True">
        <Rectangle Height="100" Width="100" Fill="Blue" />
        <Rectangle Height="100" Width="100" Fill="Red" />
        <Rectangle Height="100" Width="100" Fill="Green" />
    </GridView>

@StephenLPeters
Copy link
Contributor

@jevansaks FYI, I think you did some work in this space?

@StephenLPeters StephenLPeters added appModel-win32 Exclusive to WinUI 3 Win32 Desktop apps product-winui3 WinUI 3 issues team-Controls Issue for the Controls team and removed needs-triage Issue needs to be triaged by the area owners labels Jan 5, 2021
@anawishnoff
Copy link
Contributor

This bug has been fixed, and the fix will be available in our next release - WinUI 3 Preview 4. We're hoping to ship this preview release in early February. Thanks!

@anawishnoff anawishnoff added the fixed-internally This bug has been fixed, and the fix will be shipped in the next version of WinUI 3. label Feb 2, 2021
@bpulliam bpulliam removed the fixed-internally This bug has been fixed, and the fix will be shipped in the next version of WinUI 3. label Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
appModel-win32 Exclusive to WinUI 3 Win32 Desktop apps product-winui3 WinUI 3 issues team-Controls Issue for the Controls team
Projects
None yet
Development

No branches or pull requests

5 participants