I have ran into a number of problems with the data grid object.
1. If you remove all rows except the title row (row 0) and try to insert a row it does not work. It try to insert a row above row 0 There needs to be an action added, "Add new row below row 0" or below row x,
Another problem related to this is that if you have only one row being the title row (row 0) and then you have in your code to delete at -2 this will cause the MMF program to stop running with no error messages generated. I know someone will ask about the -2 so the answer is that you need to always keep two rows, title row (row 0) and row 1 available if you plan to "insert a row" because it will insert above row 1. Without row 1 it inserts above row 0 pushing the title row below. So if you are going to delete a number of rows you ckeck to see how many row are displayed in the data grid and you subtract 2. When you are done adding the new number of row you want you then delete the last row.
2. If you set up a data grid and then ask for the row height it
appears to not provide the right answer, and in the editing of the data grid there is no way to know the initial row height or column width in the dialog panel.
3. Before inserting a row if you do not query the grid and save the row height then the inserted row will not be of the height of the current rows.
4. It would be nice to have an action so you could say delete all rows except row 0.
5. If would be nice to have an action so you could say add x number of rows.
6. If you delete rows and then add rows the alignment for the columns is not maintained. If in the edit dialog you set the alignment to left aligned and then in your code you delete rows and add rows the alignment changes to centered.
I have been getting around the problems but have to use a lot of loops and saving extra coding.