I need to delete all existing rows from a data grid, i have tried using this but doesn't work:
public function GetMusicList(obj:Object):void{
for(var j = 0; j < mc_music.datagrid.rowCount; j++){
mc_music.datagrid.dataProvider.removeItemAt(0);
}
for(var i = 0; i < obj.length; i++){
mc_music.datagrid.addItem({Name: obj[i].toString()});
}
}
Your title is asking a different question than your actual question, but to remove all the rows just do datagrid.removeAll();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With