# Working with container in flex 3.0

**URL:** <https://forum.kirupa.com/t/working-with-container-in-flex-3-0/254129>\
**Category:** Uncategorized\
**Created:** [March 8, 2008, 6:59am UTC](https://forum.kirupa.com/t/working-with-container-in-flex-3-0/254129 "2008-03-08T06:59:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rsnv\_srikanth](https://avatars.discourse-cdn.com/v4/letter/r/bb73d2/32.png) [@rsnv\_srikanth](https://forum.kirupa.com/u/rsnv_srikanth)\
**Post date:** [March 8, 2008, 6:59am UTC](https://forum.kirupa.com/t/working-with-container-in-flex-3-0/254129/1 "2008-03-08T06:59:52Z")

</div>

hi,

## i am using adobe flex 3.0 for my designs. i am working on using drag and drop containers. while working with containers i drag and drop the container box, its works good. the code is:

\<containers:DnDContainer width=“100%” height=“200” horizontalAlign=“center” verticalAlign=“middle” paddingTop=“10” verticalGap=“10”  
direction=“horizontal” borderStyle=“solid” id=“right” backgroundColor=“blue” backgroundAlpha=".25"\>  
\<mx:Box backgroundColor=“yellow” width=“150” height=“150” mouseDown=“DnDManager.getInstance().doDrag(event)”/\>

```
            &lt;mx:Box backgroundColor="green" width="150" height="150" mouseDown="DnDManager.getInstance().doDrag(event)"/&gt;
             &lt;mx:Box backgroundColor="purple" width="150" height="150" mouseDown="DnDManager.getInstance().doDrag(event)"/&gt;

```

## \</containers:DnDContainer\>

## now i am trying to place a data grid in the container box. i need the functionality like the container box i.e. if i drag the datagrid it must move to another place. i gave datagrid clolumn property as “dragable columns” as “false”. and use the code is:

## \<containers:DnDContainer width=“100%” height=“200” horizontalAlign=“center” verticalAlign=“middle” paddingTop=“10” verticalGap=“10” direction=“horizontal” borderStyle=“solid” id=“bottom” backgroundColor=“blue” backgroundAlpha=".25"\> \<mx:Box width=“150” height=“150” mouseDown=“DnDManager.getInstance().doDrag(event)”\> \<mx:DataGrid x=“10” y=“20” width=“213” mouseDown=“DnDManager.getInstance().doDrag(event)” draggableColumns=“false”\> \<mx:columns\> \<mx:DataGridColumn headerText=“Address” dataField=“Address”/\> \<mx:DataGridColumn headerText=“City” dataField=“City”/\> \<mx:DataGridColumn headerText=“Country” dataField=“Country”/\> \</mx:columns\> \</mx:DataGrid\> \</mx:Box\> \</containers:DnDContainer\>

but it gave the error like this:

Error #1034: Type Coercion failed: cannot convert mx.controls::DataGrid@9d4c0a1 to dNdLib.containers.IDnDContainer. at dNdLib.managers::DnDManager/doDrag()

will you please reply me with solution.

thank u…

with best regards…  
srikanth
