Is it possible to control adding new row in grid?

The problem is that I have remote view represented in grid and after adding
new row (blank - without data) I am not able to leave that row. Every attempt
gives the message "Cannot insert an empty row from a view into its base table".

Is it possible to cancel that row?

Re: Controling AddNew in grid by Stefan

Stefan
Sat Dec 04 06:54:54 CST 2004


When your remote view uses Optimistic Row Buffering (default),
there is an implicit TableUpdate() attempt as soon as the record
pointer (tries to) move. So you can either explicitely try to
bSuccess = TableUpdate(...
If Not bSuccess
TableRevert(...
Endif
or, maybe less useful in you scenario, try table buffering
CursorSetProp("Buffering", 5, "yourAlias")
and care for the actual backend commit later


hth
-Stefan

<John Smith> schrieb im Newsbeitrag news:O2wIt3f2EHA.4028@TK2MSFTNGP15.phx.gbl...
>
> Is it possible to control adding new row in grid?
>
> The problem is that I have remote view represented in grid and after adding
> new row (blank - without data) I am not able to leave that row. Every attempt
> gives the message "Cannot insert an empty row from a view into its base table".
>
> Is it possible to cancel that row?
>

Re: Controling AddNew in grid by George

George
Sat Dec 04 17:44:32 CST 2004

grid.BeforeRowColChange can be helpful in validating the data before
changing rows to whether commit or revert. Use a key field as flag, if
empty, NODEFAULT will keep the row from changing. Also grid.RowColChange
property can be handy too.


John Smith wrote:
> Is it possible to control adding new row in grid?
>
> The problem is that I have remote view represented in grid and after adding
> new row (blank - without data) I am not able to leave that row. Every attempt
> gives the message "Cannot insert an empty row from a view into its base table".
>
> Is it possible to cancel that row?
>

Re: Controling AddNew in grid by George

George
Sat Dec 04 17:52:29 CST 2004

Another trick I use to avoid multiple blank records when keying down in
the last record of a grid is setting grid.AllowAddNew to true but
checking in the BeforeRowColChange if certain key field is blank then
set AllowAddNew to false so they can not key-down anymore.

HTH

George wrote:
> grid.BeforeRowColChange can be helpful in validating the data before
> changing rows to whether commit or revert. Use a key field as flag, if
> empty, NODEFAULT will keep the row from changing. Also grid.RowColChange
> property can be handy too.
>
>
> John Smith wrote:
>
>> Is it possible to control adding new row in grid?
>> The problem is that I have remote view represented in grid and
>> after adding new row (blank - without data) I am not able to leave
>> that row. Every attempt gives the message "Cannot insert an empty row
>> from a view into its base table".
>> Is it possible to cancel that row?