GetChanges doesn't

R

roger

This is maddening...

Got a DataGrid with a DataTable as the DataSource.
The DataTable in question has default values for
some of the columns, such that if I add a new row
to the grid, some of the fields are filled with the
default value and some with null.
So far so good.

Except that if I make no other change to the new row,
and then call GetChanges on the table, there aren't any.
I also tried GetChanges(DataRowState.Added), but that
didn't see the new row either.

Seems I have to actually edit one of the cells before
DataGrid believes that I've added a row.

So what - there's no way to create a new row full of
all the default values using DataGrid?

It's only a minor problem, just one more annoyance...
 
G

Greg

I have not seen this behavior. We do the exact same thing and there are
added rows if we enter no additional data other than default values.
 
R

roger

I have not seen this behavior. We do the exact same thing
and there are added rows if we enter no additional data
other than default values.

It's very regular for me. I'm using .NET version 1.1.4322 - fwiw.

I've also noticed this behavior, which is probably related:
1) click in the empty row at the bottom of the grid,
this is when the new row with default values are inserted
2) click in a different grid row, *the new row disappears*

Perhaps there's some DataGrid or DataTable property
that controls this? I don't see anything obvious though.
 
G

Greg Robinson

I would dig into the DataGrid docs as this does not sound like a
DataTable problem to me.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top