[wxPython-users] Grid Values: Getting and Setting

Werner F. Bruhin werner.bruhin at free.fr
Sun Sep 2 10:12:32 PDT 2007


Hi Rich,

Rich Shepard wrote:
> On Sun, 2 Sep 2007, Werner F. Bruhin wrote:
>
>> SetValue and GetValue "work" on one row/column and give you just that 
>> one
>> value, so you would only want to update the changed row/column and 
>> not all
>> of them in SetValue.
>
> Werner,
>
>   I saw that in the arguments passed to SetValue(), but do not grok 
> how to
> 1) identify which value changed (or was newly added) and 2) write the sql
> since the variable added/chaned could be different each time.
I keep a list ['sqlcolname1', 'sqlcolname2'] etc and the position in the 
list corresponds to the column number in the grid.  I also keep column 0 
reserved and it contains the primary key for the corresponding database 
row and that column is also in the grid but it is hidden to the user.

Hope this helps
Werner




More information about the wxpython-users mailing list