[IronPython] Data binding - how?

Dave Fugate dfugate at microsoft.com
Thu Dec 7 19:15:01 CET 2006


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: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] 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 <dfugate at microsoft.com<mailto:dfugate at microsoft.com>> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20061207/1e78b4fa/attachment.html>


More information about the Ironpython-users mailing list