apologies went for lunch...
WCDragDropItemSelection exposes the MParent variable via property in UIDragDropItem and i am setting that to previousParent if the movement is not valid. Previous parent which is a public transform inside my class BattleCard which is set whenever it gets to a new legal parent.
so at the moment i am moving the battle card from one UIGrid set as its parent...to another UIGrid, and i do some checks to see if the movement is valid...if it is not i would like to programatically move it back to it's "previousParent". which is the UIGrid it was in before the drag and drop release occurs.
I can provide a better description if necessary.
cheers
-EDIT-right okay i see what you mean i changed from
bCard.transform.GetComponent<WCDragDropItemSelection>().Parent = bCard.previousParent;
NGUITools.MarkParentAsChanged(gameObject);
bCard.previousParent.GetComponent<UIGrid>().Reposition();
to
bCard.transform.parent = bCard.previousParent;
NGUITools.MarkParentAsChanged(gameObject);
bCard.previousParent.GetComponent<UIGrid>().Reposition();
And it moves it back to the correct position, which is fantastic...Problem now is its now at the wrong depth... its going back to a rather nested grid like so
Panel->Container->UISprite->UIScrollView->Container(UIDragView)->
UIGridRather convoluted i know, but it is achieves the interface and functionality i desired. so it going back to the UIGrid show below but it's behind the UISprite(as fas as i can ascertain visually). not only that but it's position.z goes to -99 and even changing that manually to 0 while the scene is running seems to not do much.