Wednesday, March 28, 2012

Dynamic display behaviors for dragDropList

I'm using the drag drop list to allow my users to reposition report elements. The problem that I am having is that different zones have different sizes and we would like our draggable elements to resize to fill the zone in which they are dropped. Unfortunately, the controls are retaining their original sizes when moved to a different drop zone.

Furthermore, we have implemented som cascading styles to allow the controls to change appearance depending on which zone they have been places. This is not working either, the controls always retaing the style of the zone in which they were originally placed.

Any suggestions?

Yeah, you should build a behavior that implements the IDropTarget interface, and assign that behavior to whatever Divs you've go tthat are going to be the drop zones for your parts. The custom behavior you build has to implement this.drop() , among others, and that funciton will define what happens when something's dropped on it. My guess is that you'd build logic into the drop() method that tells the div that was dropped to resize / restyle itself, possibly by just changing the cssClass . Check out this article: http://www.codeproject.com/Ajax/AtlasDragNDrop.asp for more info.

No comments:

Post a Comment