If you want to add new empty row
if(dataGridId.dataProvider == null)
dataGridId.dataProvider = new ArrayCollection();
else you can add object as per your code means of any object of any VO or Class.
But my dataProvider is an XML based. Will that work?
It wont add empty row by just adding new Object as your dataGrid dataProvider is binded with one XML. It will work for arrayCollection of Objects.