471,326 Members | 2,490 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,326 software developers and data experts.

DataGrid, AllowNew, pasting inserts rows

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

Jan 9 '06 #1
1 1645
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.

Jan 10 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.