Do you mean to just override the built-in drag-n-drop of the datagrid like this?

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";>
        <mx:Script>
                <![CDATA[
                        import mx.controls.Image;
                        import mx.core.IUIComponent;
                        import mx.managers.DragManager;
                        import mx.core.DragSource;

                        [Embed(source='rssIcon.jpg')]
                        private var proxy:Class;

                        public function dragIt( eventObj:MouseEvent ):void
                        {
                                var ds:DragSource = new DragSource();
                                var dragProxy:Image = new Image();
         dragProxy.source = new proxy();
DragManager.doDrag( eventObj.target as IUIComponent, ds, eventObj, dragProxy );
                        }
                ]]>
        </mx:Script>

        <mx:DataGrid dataProvider="{ employees }" mouseMove="dragIt( event )">
                <mx:columns>
                        <mx:DataGridColumn dataField="name" headerText="Name"/>
            <mx:DataGridColumn dataField="phone" headerText="Phone"/>
            <mx:DataGridColumn dataField="email" headerText="Email"/>
                </mx:columns>
        </mx:DataGrid>
   <mx:XMLList id="employees">
        <employee>
            <name>Christina Coenraets</name>
            <phone>555-219-2270</phone>
            <email>[EMAIL PROTECTED]</email>
            <active>true</active>
        </employee>
        <employee>
            <name>Joanne Wall</name>
            <phone>555-219-2012</phone>
            <email>[EMAIL PROTECTED]</email>
            <active>true</active>
        </employee>
        <employee>
            <name>Maurice Smith</name>
            <phone>555-219-2012</phone>
            <email>[EMAIL PROTECTED]</email>
            <active>false</active>
        </employee>
        <employee>
            <name>Mary Jones</name>
            <phone>555-219-2000</phone>
            <email>[EMAIL PROTECTED]</email>
            <active>true</active>
        </employee>
    </mx:XMLList>
</mx:Application>

On Oct 23, 2007, at 8:34 AM, aseelund wrote:

Hi All, Im trying to override the datagridproxy image, and its not
working over so well.

Ive been using Derrick Grigg's CustomDragProxy
(http://www.dgrigg.com/post.cfm/11/03/2006/DataGrid-Drag-Image) class
and i cant modify it to my needs. Basically, ive got a datagrid, and
im only dragging one item at a time, so multi-select isnt necessary. I
just want to change the dragimage to be an icon i created, and drag
that onto a canvas.
the drop part is working, but the drag image is my holdup.

any suggestions?




Regards,

Rob Rusher
[EMAIL PROTECTED]



Reply via email to