<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Flex Examples &#187; removeItemAt()</title>
	<atom:link href="http://blog.flexexamples.com/tag/removeitemat/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Wed, 26 Jan 2011 18:09:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Adding a delete button in the hovered state of a Spark List control item renderer in Flex 4</title>
		<link>http://blog.flexexamples.com/2010/04/09/adding-a-delete-button-in-the-hovered-state-of-a-spark-list-control-item-renderer-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2010/04/09/adding-a-delete-button-in-the-hovered-state-of-a-spark-list-control-item-renderer-in-flex-4/#comments</comments>
		<pubDate>Fri, 09 Apr 2010 23:10:34 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Flex4]]></category>
		<category><![CDATA[List (Spark)]]></category>
		<category><![CDATA[getItemIndex()]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[itemRenderer]]></category>
		<category><![CDATA[mouseDown]]></category>
		<category><![CDATA[owner]]></category>
		<category><![CDATA[removeItemAt()]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=2718</guid>
		<description><![CDATA[<p>The following example shows how you can add a delete button to the hovered state of a Spark List control item renderer in Flex 4 by creating a custom item renderer and listening for the mouseDown event.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2010/04/09/adding-a-delete-button-in-the-hovered-state-of-a-spark-list-control-item-renderer-in-flex-4/ --&#62; &#60;s:Application name=&#34;Spark_List_itemRenderer_hovered_test&#34; xmlns:fx=&#34;http://ns.adobe.com/mxml/2009&#34; xmlns:s=&#34;library://ns.adobe.com/flex/spark&#34; xmlns:mx=&#34;library://ns.adobe.com/flex/mx&#34;&#62; &#160; &#60;s:List id=&#34;lst&#34; itemRenderer=&#34;skins.CustomItemRen&#34; width=&#34;300&#34; horizontalCenter=&#34;0&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can add a delete button to the hovered state of a Spark List control item renderer in Flex 4 by creating a custom item renderer and listening for the <code>mouseDown</code> event.</p>
<p><span id="more-2718"></span></p>
<p class="alert">The following example(s) require Flash Player 10 and the Adobe Flex 4 SDK. To download the Adobe Flash Builder 4 trial, see <a href="http://bit.ly/crThlI">http://www.adobe.com/products/flex/</a>. To download the latest nightly build of the Flex 4 SDK, see <a href="http://bit.ly/Flex4SDK">http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4</a>.<br/><strong>For more information on getting started with Flex 4 and Flash Builder 4, see the official <a href="http://bit.ly/dCkecm">Adobe Flex Team blog</a>.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2010/04/09/adding-a-delete-button-in-the-hovered-state-of-a-spark-list-control-item-renderer-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;Spark_List_itemRenderer_hovered_test&quot;</span></span>
<span style="color: #000000;">        xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span></span>
<span style="color: #000000;">        xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/mx&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:List</span> id=<span style="color: #ff0000;">&quot;lst&quot;</span></span>
<span style="color: #000000;">            itemRenderer=<span style="color: #ff0000;">&quot;skins.CustomItemRen&quot;</span></span>
<span style="color: #000000;">            width=<span style="color: #ff0000;">&quot;300&quot;</span></span>
<span style="color: #000000;">            horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:layout</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:VerticalLayout</span> gap=<span style="color: #ff0000;">&quot;0&quot;</span></span>
<span style="color: #000000;">                    horizontalAlign=<span style="color: #ff0000;">&quot;justify&quot;</span></span>
<span style="color: #000000;">                    requestedRowCount=<span style="color: #ff0000;">&quot;8&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:layout</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:ArrayList</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;Application&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;BorderContainer&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;Button&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;ButtonBar&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;CheckBox&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;ComboBox&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;DataGroup&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;DataRenderer&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;DropDownList&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;Group&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;HGroup&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;HScrollBar&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;HSlider&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;Label&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;List&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:ArrayList</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:List</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>And the custom Spark List item renderer, <em>skins/CustomItemRen.mxml</em>, is as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2010/04/09/adding-a-delete-button-in-the-hovered-state-of-a-spark-list-control-item-renderer-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:ItemRenderer</span> name=<span style="color: #ff0000;">&quot;CustomItemRen&quot;</span></span>
<span style="color: #000000;">        xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span> </span>
<span style="color: #000000;">        xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span> </span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/mx&quot;</span> </span>
<span style="color: #000000;">        autoDrawBackground=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #000000;">        minHeight=<span style="color: #ff0000;">&quot;24&quot;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:states</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:State</span> name=<span style="color: #ff0000;">&quot;normal&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:State</span> name=<span style="color: #ff0000;">&quot;hovered&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:State</span> name=<span style="color: #ff0000;">&quot;selected&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:states</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;">&lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span></span>
<span style="color: #000000;">            import mx.controls.Alert;</span>
<span style="color: #000000;">            import mx.events.CloseEvent;</span>
&nbsp;
<span style="color: #000000;">            import spark.components.List;</span>
&nbsp;
<span style="color: #000000;">            protected function button1_clickHandler<span style="color: #66cc66;">&#40;</span>evt:MouseEvent<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                Alert.show<span style="color: #66cc66;">&#40;</span>data.label,</span>
<span style="color: #000000;">                        <span style="color: #ff0000;">&quot;Are you sure you want to delete this item?&quot;</span>,</span>
<span style="color: #000000;">                        Alert.YES|Alert.CANCEL,</span>
<span style="color: #000000;">                        null,</span>
<span style="color: #000000;">                        alrt_closeHandler<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            protected function alrt_closeHandler<span style="color: #66cc66;">&#40;</span>evt:CloseEvent<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                switch <span style="color: #66cc66;">&#40;</span>evt.detail<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                    case Alert.YES:</span>
<span style="color: #000000;">                    case Alert.OK:</span>
<span style="color: #000000;">                        Object<span style="color: #66cc66;">&#40;</span>owner<span style="color: #66cc66;">&#41;</span>.dataProvider.removeItemAt<span style="color: #66cc66;">&#40;</span>itemIndex<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                        break;</span>
<span style="color: #000000;">                    case Alert.CANCEL:</span>
<span style="color: #000000;">                    case Alert.NO:</span>
<span style="color: #000000;">                        Object<span style="color: #66cc66;">&#40;</span>owner<span style="color: #66cc66;">&#41;</span>.selectedIndex = -<span style="color: #cc66cc;">1</span>;</span>
<span style="color: #000000;">                        break;</span>
<span style="color: #000000;">                    default:</span>
<span style="color: #000000;">                        break;</span>
<span style="color: #000000;">                <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:HGroup</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> height=<span style="color: #ff0000;">&quot;100%&quot;</span></span>
<span style="color: #000000;">            verticalAlign=<span style="color: #ff0000;">&quot;middle&quot;</span></span>
<span style="color: #000000;">            paddingLeft=<span style="color: #ff0000;">&quot;2&quot;</span> paddingRight=<span style="color: #ff0000;">&quot;2&quot;</span></span>
<span style="color: #000000;">            paddingTop=<span style="color: #ff0000;">&quot;2&quot;</span> paddingBottom=<span style="color: #ff0000;">&quot;2&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Label</span> id=<span style="color: #ff0000;">&quot;lbl&quot;</span> text=<span style="color: #ff0000;">&quot;{data.label}&quot;</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> id=<span style="color: #ff0000;">&quot;btn&quot;</span></span>
<span style="color: #000000;">                accentColor=<span style="color: #ff0000;">&quot;red&quot;</span> emphasized=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #000000;">                includeIn=<span style="color: #ff0000;">&quot;hovered&quot;</span></span>
<span style="color: #000000;">                width=<span style="color: #ff0000;">&quot;12&quot;</span> height=<span style="color: #ff0000;">&quot;12&quot;</span></span>
<span style="color: #000000;">                mouseDown=<span style="color: #ff0000;">&quot;button1_clickHandler(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:HGroup</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:ItemRenderer</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p class="information"><a href="http://dl.dropbox.com/u/4509565/FlexExamples_com/Spark_List_itemRenderer_hovered_test/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://dl.dropbox.com/u/4509565/FlexExamples_com/Spark_List_itemRenderer_hovered_test/main.html" width="100%" height="300"></iframe></p>
<p class="alert">This entry is based on a beta version of the Flex 4 SDK and therefore is very likely to change as development of the Flex SDK continues. The API can (and will) change causing examples to possibly not compile in newer versions of the Flex 4 SDK.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Adding a delete button in the hovered state of a Spark List control item renderer in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2010/04/09/adding-a-delete-button-in-the-hovered-state-of-a-spark-list-control-item-renderer-in-flex-4/',contentID: 'post-2718',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'getItemIndex(),Gumbo,itemRenderer,mouseDown,owner,removeItemAt()',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2010/04/09/adding-a-delete-button-in-the-hovered-state-of-a-spark-list-control-item-renderer-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Removing items from a Flex DataGrid control using the DragManager class</title>
		<link>http://blog.flexexamples.com/2008/04/16/removing-items-from-a-flex-datagrid-control-using-the-dragmanager-class/</link>
		<comments>http://blog.flexexamples.com/2008/04/16/removing-items-from-a-flex-datagrid-control-using-the-dragmanager-class/#comments</comments>
		<pubDate>Thu, 17 Apr 2008 03:51:52 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[DataGrid]]></category>
		<category><![CDATA[DragManager]]></category>
		<category><![CDATA[acceptDragDrop()]]></category>
		<category><![CDATA[dragDrop]]></category>
		<category><![CDATA[dragEnabled]]></category>
		<category><![CDATA[getItemIndex()]]></category>
		<category><![CDATA[removeItemAt()]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/04/16/removing-items-from-a-flex-datagrid-control-using-the-dragmanager-class/</guid>
		<description><![CDATA[<p>The following example shows how you can drag an item from a Flex DataGrid control onto an Image control to remove the item from a data provider.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/DragManager_acceptDragDrop_test/bin/srcview/source/main.mxml.html">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/04/16/removing-items-from-a-flex-datagrid-control-using-the-dragmanager-class/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:Script&#62; &#60;![CDATA[ import mx.core.IUIComponent; import mx.events.DragEvent; import [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can drag an item from a Flex DataGrid control onto an Image control to remove the item from a data provider.</p>
<p>Full code after the jump.</p>
<p><span id="more-595"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/DragManager_acceptDragDrop_test/bin/srcview/source/main.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/04/16/removing-items-from-a-flex-datagrid-control-using-the-dragmanager-class/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.core.IUIComponent;
            import mx.events.DragEvent;
            import mx.managers.DragManager;

            private function image_dragEnter(evt:DragEvent):void {
                var obj:IUIComponent = IUIComponent(evt.currentTarget);
                DragManager.acceptDragDrop(obj);
            }

            private function image_dragDrop(evt:DragEvent):void {
                var item:Object = dataGrid.selectedItem;
                var idx:int = arrColl.getItemIndex(item);
                arrColl.removeItemAt(idx);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:ArrayCollection id="arrColl"&gt;
        &lt;mx:source&gt;
            &lt;mx:Array&gt;
                &lt;mx:Object c1="r1.c1" c2="r1.c2" c3="r1.c3" c4="r1.c4"/&gt;
                &lt;mx:Object c1="r2.c1" c2="r2.c2" c3="r2.c3" c4="r2.c4"/&gt;
                &lt;mx:Object c1="r3.c1" c2="r3.c2" c3="r3.c3" c4="r3.c4"/&gt;
                &lt;mx:Object c1="r4.c1" c2="r4.c2" c3="r4.c3" c4="r4.c4"/&gt;
                &lt;mx:Object c1="r5.c1" c2="r5.c2" c3="r5.c3" c4="r5.c4"/&gt;
                &lt;mx:Object c1="r6.c1" c2="r6.c2" c3="r6.c3" c4="r6.c4"/&gt;
                &lt;mx:Object c1="r7.c1" c2="r7.c2" c3="r7.c3" c4="r7.c4"/&gt;
                &lt;mx:Object c1="r8.c1" c2="r8.c2" c3="r8.c3" c4="r8.c4"/&gt;
                &lt;mx:Object c1="r9.c1" c2="r9.c2" c3="r9.c3" c4="r9.c4"/&gt;
            &lt;/mx:Array&gt;
        &lt;/mx:source&gt;
    &lt;/mx:ArrayCollection&gt;

    &lt;mx:Panel title="Drag DataGrid item over the trash icon to remove item"
            styleName="opaquePanel"&gt;
        &lt;mx:DataGrid id="dataGrid"
                dataProvider="{arrColl}"
                dragEnabled="true"
                width="400"
                rowCount="6"
                verticalScrollPolicy="on"&gt;
            &lt;mx:columns&gt;
                &lt;mx:DataGridColumn dataField="c1"
                        headerText="Column 1" /&gt;
                &lt;mx:DataGridColumn dataField="c2"
                        headerText="Column 2" /&gt;
                &lt;mx:DataGridColumn dataField="c3"
                        headerText="Column 3" /&gt;
                &lt;mx:DataGridColumn dataField="c4"
                        headerText="Column 4" /&gt;
            &lt;/mx:columns&gt;
        &lt;/mx:DataGrid&gt;

        &lt;mx:ControlBar horizontalAlign="right"&gt;
            &lt;mx:Image id="image"
                    source="@Embed('assets/iconUninstall.png')"
                    dragDrop="image_dragDrop(event);"
                    dragEnter="image_dragEnter(event);" /&gt;
        &lt;/mx:ControlBar&gt;
    &lt;/mx:Panel&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/DragManager_acceptDragDrop_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/DragManager_acceptDragDrop_test/bin/main.html" width="100%" height="300"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Removing items from a Flex DataGrid control using the DragManager class on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/04/16/removing-items-from-a-flex-datagrid-control-using-the-dragmanager-class/',contentID: 'post-595',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'acceptDragDrop(),dragDrop,dragEnabled,getItemIndex(),removeItemAt()',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/04/16/removing-items-from-a-flex-datagrid-control-using-the-dragmanager-class/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>

