Going Nuts with DataGrid

Going Nuts with DataGrid

Post by approach_maste » Wed, 15 Sep 1999 04:00:00



Hi all.
Can anyone explain why when i do an AddNew on an ADO recordset I get a row
inserted in the DataGrid.
Specially when I have the AllowAddNew (as well as the other update props)
set to false on the DataGrid.
According to the documentation it aint suppose to happen.
It would be no big deal except when i cancel the update i get an error on
the datagrid "Cannot insert an empty row - must have at least one column
value set."

Any ideas would be greatly appreciated.

 
 
 

Going Nuts with DataGrid

Post by Frank H?rnlei » Wed, 15 Sep 1999 04:00:00


Hi there
I've got the same problem with datagrid

My answer is quit simple

set datagrid = nothing
with table
    .addnew
    . . .
    . . .
    .update
    .requery
end with
set datagrid.datasource = table

approach_master schrieb:

Quote:> Hi all.
> Can anyone explain why when i do an AddNew on an ADO recordset I get a row
> inserted in the DataGrid.
> Specially when I have the AllowAddNew (as well as the other update props)
> set to false on the DataGrid.
> According to the documentation it aint suppose to happen.
> It would be no big deal except when i cancel the update i get an error on
> the datagrid "Cannot insert an empty row - must have at least one column
> value set."

> Any ideas would be greatly appreciated.


 
 
 

Going Nuts with DataGrid

Post by Jimm » Wed, 15 Sep 1999 04:00:00


Simple!

1) The AllowAddNew property merely controls
whether a USER can add records to the recordset USING
the datacontrol at run-time

2) The datagrid is bound to the recordset and displays
whatever is in the recordset. If you add a record in code
it will be there.


>Hi all.
>Can anyone explain why when i do an AddNew on an ADO recordset I get a row
>inserted in the DataGrid.
>Specially when I have the AllowAddNew (as well as the other update props)
>set to false on the DataGrid.
>According to the documentation it aint suppose to happen.
>It would be no big deal except when i cancel the update i get an error on
>the datagrid "Cannot insert an empty row - must have at least one column
>value set."

>Any ideas would be greatly appreciated.