Le 19/03/2014 23:59, T Lee Davidson a écrit :
> In the Gambas3 Documentation at
> http://www.gambasdoc.org/help/comp/gb.form/tableview?v3 it says:
> "Hitting the ENTER or the RETURN key moves to the next cell like the
> right arrow key. But if the end of the TableView is reached, the Insert
> event is raised."
>
> I surmised that this will trigger the Save event. But the ENTER key (on
> the numeric keypad) does not trigger the Save event.
>
> Is this and error in the Docs, or a bug, or something else I may have
> missed?
>
> Thanks,
> Lee
>

The ENTER or RETURN key does raise the Save event, but the event is 
raised only if needed (i.e. if the cell has been modified).

> P.S. On semi-related note, That page also says, "If the user modifies
> the cell contents, then the Save event is raised, and you must actually
> save the data during the Save event handler. This is not automatic!"
>
> Not realizing exactly what, "save the data," meant, I called
> TableView.Save from within the Save event to save the data. I got a
> Stack Overflow error. Duh.
>
> The data just needs to be written to the TableView cell as in
> "TableView1[Row, Column].Text = Value".
>

The Save event means that you have to save the new data somewhere, 
because the TableView won't do it for you. The new data to save is the 
third argument of the Save event handler.

Then it's up to you to decide if you store the actual TableView contents 
inside the TableView (i.e. by setting the Text property of the cell 
explicitely), or if you provide the contents through the Data event.

The Save() method is called to trigger all that process (it means "do 
raise the Save event"). It actually saves nothing. So don't call it from 
the Save event handler!



Regards,

-- 
Benoît Minisini

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Gambas-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to