I'm afraid I'm just going to muddy things rather than add clarity,
but I fear some of the problems here are caused by the mapping
between Python and C++. The PropertyGrid clearly has a C++-centric
design. GetPropertyValues returns an array of "PGVariant" objects,
which is a generic way of storing things of different types in a
strongly-typed language. So, when you say
d['SERIAL_NUMBER'] += 1
my guess is that something in the C++/Python interface is
incorrectly converting the operating to strings, so the addition
becomes a string concatenation, and the concatenated result back to
the property grid.
I started to write a reply to the original mail, suggesting that you
needed to do something SIMILAR to:
oldvalue = grid.GetIntPropertyValye('SERIAL_NUMBER')
grid.SetIntPropertyValue('SERIAL_NUMBER', oldvalue+1)
However, I couldn't find the APIs that would do that, so I abandoned
my reply. I think your path to happiness lies somewhere along that
line. Although it's contrary to the Python philosophy, because the
C++ code has these variant objects, I think you're going to need to
do some type-specific stuff.
Or, perhaps you just assume the interface is all strings, and do
something similar to
newvalue = str( int(oldvalue) + 1 )
if you can figure out how to spell that.
--
Tim Roberts, ti...@probo.com
Providenza & Boekelheide, Inc.