Actually, here is something that might work better for you.  If you use ArrayCollections as the dataProviders for both of the DataGrids, you can watch for the collectionChanged event on the ArrayCollections and recalculate the totals when the collection changes.  That way you can programmatically add and remove rows and not have to recode all your logic J  Nice and easy.  Read the docs on the ArrayCollection and check out the collectionChanged event.  That should get you going. 

 

Dustin Mercer

 


From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of s_hernandez01
Sent: Wednesday, October 04, 2006 6:38 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Drag n Drop between 2 Datagrids

 

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
>

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to