DataView AllowNew

G

Guest

I have the AllowNew set to true is a DataView bound DataGrid. When i leave
the Datagrid and return to the same Grid by clicking directly on the last
row, (the *New Row) the grid sometimes removes the asterisk and the row does
not function properly.

I tried a dataGrid.Enter event to check if the row isNew, but it doesnt
detect it as a new row.

any thoughts?
 
C

Cor Ligthert

Subt,

By me it does not function when the underlaying datasource is empty, I do
not know why they made it this way, however for me it gives only errors and
do not know a workaround, other than completly set it off by addnew = false
and create some buttons.

Maybe you get a better answer, than I have it as well.

Cor
 
G

Guest

my workaround:
instead i set allownew= false on default.
used Currentcell Changed event,
if cm.position=cm.count-1 then
set allownew=true
dataview.addnew()
....
then set allownew= false.

this seems to work so far. autoadds row without the asterisk row. not
gettting errors yet when i reenter grid.
 
G

Guest

sorry, problem is same. Problem seems to be that after Update, the Currency
Manager position is fixed at 0. the CurrencyManager.count is accurate but the
position will not update with changed row. It will only start working again
if the position 0 row is clicked first.
any idea why this is so?
 
C

Cor Ligthert

Subt,

I thought I had added a message to yours however I did not, I was suprised
because I thought the -1 and I use de datarow or dataview count = 0.

However for the rest I use the almost same routines like you did for this.

I have not found a good solution yet.

Cor
 
C

Cor Ligthert

Subt,

That is the pain I have as well.

So therefore I have for this kind of problems changed the dataview.allownew
to false and since a while when I add a row make it temporary allownew =
true.

And just toolbarbuttons on the form for New, Deleting, Adding and update.

As I understand what you are using now than you have probably a datagrid
with pencil and a row. However that row in the datagrid is referencing to a
null datarow.

Cor
 

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