hi all i have this code to delete rows in my grid but if there is no selected row it gives an error what i would like is to set focus on the new row so it won't give any error

to add Rows
[Bindable]
private var _xlcdatagrid:XMLListCollection;
[Bindable]
private var _xlcdatagrid2:XMLListCollection = new XMLListCollection;

private function onResult(oEvent:ResultEvent):void
{
_xlcdatagrid = new XMLListCollection(oEvent.result.name)
datagrid.dataProvider = _xlcdatagrid;
}
private function selectItem():void
{
_xlcdatagrid2.addItem(datagrid.selectedItem);
}


delete code:
function deleteRow():void {
if (datagrid2.selectedIndex!=undefined) {
_xlcdatagrid2.removeItemAt(datagrid2.selectedIndex);

}


__._,_.___

--
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
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to