views:

245

answers:

1

I searched but couldn't find my answer, I'm sure it's easy for anyone with a little experience. I have multiple datagrids on a page, each one I want sortable with drag and drop, but I don't want items drug from one control to the other. How can I prevent a user from dragging an item out of a conrol. I would prefer to have it just stop moving with the mouse, but I am prepared to just completely cancel out of the dragging if need be.
I was trying to do something like this

dragExit="dragEvent.CANCEL"

This is obviously wrong, but I can't find the correct way to do it.

Thanks in advance. ~Mike

A: 

Ok, so you have an app with multiple drag/drop datagrids, and you only want items dragged within a datagrid, and not from 1 to the other, is how I understand this.

What you need to do is create a custom dragDrop event handler for each datagrid which has the following command: event.preventDefault(). This in effect will stop a datagrid from receiving items from another .

This does not prohibit the dragging an item outside its host's borders, but it will prohibit the item being dropped into a different datagrid.

HTH.

adamcodes