Why is there an additional row in my DataGrid
?
My DataSource
has 15 rows.
source.DataSource = dt;
MessageBox.Show(Convert.ToString(source.Count)); // shows 15
dataGrid1.ItemsSource = source;
MessageBox.Show(Convert.ToString(dataGrid1.Items.Count)); // shows 16
My DataGrid
has 16 rows, the last one is null.
How can I do delete the last row?