Most often you may need to delete data from a datagrid in your application.
The code below shows one of the ways in which you can delete the corresponding row in your application.
Here I am placing a button in the datagrid for deleting and on its click I am getting the index of the datagrid, thus identifying the row.
Then by using


I removed the row from it.
After that I am just refreshing the data in the Datagrid.
See the example below.

<?xml version=”1.0″ ?>
<mx:Application xmlns:mx=””>
import mx.controls.DataGrid;
import mx.collections.XMLListCollection;
private var my_xml:XML =   <data>
[Bindable] private var DataProvider:XMLListCollection = new XMLListCollection(my_xm..item1);
public function deleteItem(event:MouseEvent):void{
<mx:DataGrid id=”DataGrid” dataProvider=”{DataProvider}”>
<mx:DataGridColumn headerText=”  Text “
<mx:Text text=”{data}”/>
<mx:DataGridColumn headerText=”Delete this Row”>
<mx:LinkButton label=”Delete”

Please post your comments on this post.


One Comment

  1. Pingback: Tweets that mention How to remove an item in a row in Datagrid in Adobe AIR or FLEX?- Coderz Heaven --

Leave a Reply

Your email address will not be published. Required fields are marked *




Theme by HermesThemes

Copyright © 2018 CoderzHeaven. All Rights Reserved

Please wait...

Subscribe to our newsletter

Want to be notified when our article is published? Enter your email address and name below to be the first to know.