OK, I've now recreated your sample in C# and found it basically works. I just
commented out the calls to Columns.Add(...) and changed the ages from integers
to strings just to be on the safe side.
On a hunch, I redefined "people" in your original Python code to:
people = System.Collections.Generic.List[Person]()
and
people = System.Collections.Generic.List[System.Object]()
Neither of these work either so it does not appear to be a mismatch between
Python and CLR list types. At this point, I'm fairly sure that there's a bug
or unimplemented feature in IronPython where Python properties do not map to
CLR properties as you say. An educated guess is that this might have something
to do with the fact that the Python property decorator does not give the type.
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Patrick O'Brien
Sent: Thursday, December 07, 2006 9:35 AM
To: Discussion of IronPython
Subject: Re: [IronPython] Data binding - how?
On 12/6/06, Dave Fugate <[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>> wrote:
I looked into trying to replace the Python class full of properties with a list
full of tuples. That is, doing something similar to:
#...
data = [
('Joe', 23),
('Bob', 8),
('Thomas', 32),
('Patrick', 41),
('Kathy', 19),
('Sue', 77),
]
#...
grid.DataSource = data
as was suggested in an earlier email. As far as I can tell you're limited to
one-dimensional arrays for the DataSource as is suggested by
http://www.vbdotnetforums.com/showthread.php?t=14657 .
That makes sense. Thanks for the clarification, Dave. :-)
--
Patrick K. O'Brien
Orbtech http://www.orbtech.com
Schevo http://www.schevo.org
Louie http://www.pylouie.org
_______________________________________________
users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com