The results of running this code are very strange, but may help someone
track down how to bind a data grid view to a list of python objects.  The
following three columns get created: Count, SyncRoot, and IsSynchronized.
Does this make sense to anyone?


import clr
import System

clr.AddReference('System.Windows.Forms')
import System.Windows.Forms as SWF


class Form(SWF.Form):

   def __init__(self):
       SWF.Form.__init__(self)
       data = [
           ('Joe', 23),
           ('Bob', 8),
           ('Thomas', 32),
           ('Patrick', 41),
           ('Kathy', 19),
           ('Sue', 77),
           ]
       grid = SWF.DataGridView()
       grid.AutoGenerateColumns = True
       grid.DataSource = data
       grid.Dock = SWF.DockStyle.Fill
       self.Controls.Add(grid)


if __name__ == '__main__':
   SWF.Application.EnableVisualStyles()
   form = Form()
   SWF.Application.Run(form)


--
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

Reply via email to