Hey there,

I am planning to have two TreeViews, and both should have items that can be
dragged & dropped into each other.
However, there are also "category" nodes that include the actual data nodes.

I do not want a whole "category" node to be dragged around, only its child
items.
Now my question: How would I prevent the dragging of such a node?

What I tried was the following:

//-------------------------------------------------------------
//-------------------------------------------------------------
treeView.DragBegin += HandleMyDragBegin;
.....

[GLib.ConnectBefore]
void HandleMyDragBegin (object o, DragBeginArgs args)
{
        TreeIter iter;
        if (treeView.Selection.GetSelected(out iter)) 
        {
                ...find out if selected node is a category, works...
                if (isCategory)
                {
                        *args.RetVal = false;*
                }
        }
}
//-------------------------------------------------------------
//-------------------------------------------------------------

But that did not achieve anything.
Is there even a way to stop the dragging or is the best I can do to not
accept the "category" node when dropped?

--
View this message in context: 
http://mono.1490590.n4.nabble.com/Cancel-Drag-Drop-nefore-it-really-starts-tp4354127p4354127.html
Sent from the Mono - Gtk# mailing list archive at Nabble.com.
_______________________________________________
Gtk-sharp-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list

Reply via email to