In my Silverlight Datagrid, I got a Totals row that sums up the values in all the previous rows. I need to let the user add new rows to the grid but I need it to be displayed before the Totals row, although the Totals row already is display in the Datagrid.
This is how I insert a new row in the Datagrid (QuotationDG):
CultureInfo provider = new CultureInfo("en-US");
Object[] myrow = new Object[QuotationDG.Columns.Count];
for (int i = 0; i < QuotationDG.Columns.Count; i++ )
{
myrow[i] = Convert.ChangeType("", typeof(object), provider);
i++;
}
MyData.Add(myrow); // MyData is an Observable collection of Object[]
QuotationDG.ItemsSource = MyData;
The empty rows are edited by the user to enter data.
How can I enter such a row at a specific index of MyData ?