DataGrid, AllowNew, pasting inserts rows

  • Thread starter Thread starter whitecrow
  • Start date Start date
W

whitecrow

Hi All,

I have a DataGrid that is a visual representation of a DataSet. It was
created like so:
dataset = new DataSet();
adapter.Fill(dataset);
dataGridTable.DataSource = dataset.Tables[0];
dataGridTable.TableStyles.Clear();
DataGridTableStyle tableStyle = new DataGridTableStyle();
dataGridTable.TableStyles.Add(tableStyle);

I'd like to prevent users from adding new rows, while still allowing
them to edit table data. So, I did:
dataset.Tables[0].DefaultView.AllowNew = false;
dataset.Tables[0].DefaultView.AllowEdit = true;

OK, I no longer see that last row of the DataGrid with the "*" on it,
so it _looks_ like I've been prevented from inserting new rows, but
there is a problem.
Try:
Select and copy two rows
Select two other rows and paste over them

Expect to see:
Copied information pasted over the selected rows.

But See:
The two rows you were trying to paste appear as newly inserted rows.

Can anyone tell me what's going on and how to fix it? Am I missing
something basic?

Thanks much,
whitecrow
 
Hmm, I've kept on playing with this. It really looks like a bug in the
language, but I'm just a beginner -- it's extremely unlikely that I've
actually found a language bug. Still can't solve it, though.
 
Back
Top