Yes, I know that way but just coding dragEnabled=true
and
dropEnabled=true will only carry an object over, and I need it to drag
n drop over to the other datagrid with a dragSource because I have a
total calculating all the prices that get dropped in. The only way of
doing this, is using the DragManager with a dragSource and dropSource
functionality. Somebody please help me with this actionscript 3 coding.
-Sal
--- In [EMAIL PROTECTED]ups.com,
"Igor Costa" <[EMAIL PROTECTED]..> wrote:
>
> Yeah man it's simple way
>
> here you could also do.
>
>
> just create two datagrids than, using the property in the first one,
> dragEnabled=true and in the second one you could do, dropEnabled=true
>
> Than worked.
>
> here a short example
>
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute">
> <mx:Script>
> <![CDATA[
>
> public function gridLimpar():void
> {
> grid1.dataProvider = null;
> }
> ]]>
> </mx:Script>
> <mx:Model id="meugrid" source="listao.xml"/>
>
> <mx:Panel title="Grid de exemplo" width="200"
height="200" x="10"
> y="10">
> <mx:DataGrid id="grid1" dragEnabled="true"
allowDragSelection="true"
>
> allowMultipleSelection="true" dataProvider="{meugrid.item}"
> width="100%" height="100%">
> <mx:columns>
> <!-- definindo as colunas -->
> <mx:DataGridColumn headerText="Tipo de produto"
> dataField="produto" editable="false"/>
> <mx:DataGridColumn headerText="Preço"
dataField="preco"
> editable="false"/>
> <mx:DataGridColumn headerText="Preço"
dataField="preco"
> editable="false">
> <mx:itemRenderer>
> <mx:Component>
> <mx:Image source="icones/accept.png"/>
> </mx:Component>
> </mx:itemRenderer>
> </mx:DataGridColumn>
> </mx:columns>
> </mx:DataGrid>
> </mx:Panel>
> <mx:DataGrid dragEnabled="true" dropEnabled="true"
> allowDragSelection="true" x="234"
y="23">
> <mx:columns>
> <mx:DataGridColumn headerText="Tipo de produto"
> dataField="produto"/>
> <mx:DataGridColumn headerText="Preço de produto"
> dataField="preco"/>
> <mx:DataGridColumn headerText="Quantidade em estoque"
> dataField="quant"/>
> </mx:columns>
> </mx:DataGrid>
> <mx:Panel x="544" y="23" width="250"
height="200" layout="absolute"
> title="Itens escolhidos">
> <mx:DataGrid width="100%" height="100%"
dropEnabled="true"
> allowDragSelection="true" x="0"
y="0"/>
> </mx:Panel>
> <mx:Button x="89" click="gridLimpar();"
y="218" label="Limpar"/>
>
> </mx:Application>
>
>
> Regards
>
>
> On 10/3/06, s_hernandez01 <s_hernandez01@...> wrote:
> >
> > Would anyone have any source code on how to drag n drop between 2
> > datagrids using the Drag Manager?
> >
> > -Sal
> >
> >
> >
>
>
>
> --
> ----------------------------
> Igor Costa
> www.igorcosta.com
>