Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How to implement drag-and-drop for inner cells in my grid?

0
Posted

How to implement drag-and-drop for inner cells in my grid?

1

You can implement drag-and-drop for any grid derived from CExtGridWnd. Here are some key points to keep in mind: • To enable drag-and-drop functionality, override the CExtGridWnd::OnGbwDataDndIsAllowed() virtual method: it should simply return true; • You can suppress drag-and-drop for a particular cell(s) by overriding CExtGridWnd::OnGbwDataDndCanStart(): it should return false when appropriate; • Implement your drag-and-drop algorithm itself in the CExtGridWnd::OnGbwDataDndDo()virtual method; • Implement the standard IDropSource and IDropTarget interfaces so that you can catch drag-and-drop events in your application. You should implement IDropTarget whenever you want: your grid, other window, or even some other application. You can see the implementation details in the FormEditor sample, where the user can drag-and-drop items from the toolbox onto a form.

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123