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?
<br><br><br>import clr<br>import System<br><br>clr.AddReference('System.Windows.Forms')<br>import System.Windows.Forms as SWF<br><br><br>class Form(SWF.Form):<br><br> def __init__(self):<br> SWF.Form.__init__(self)
<br> data = [<br> ('Joe', 23),<br> ('Bob', 8),<br> ('Thomas', 32),<br> ('Patrick', 41),<br> ('Kathy', 19),<br> ('Sue', 77),<br> ]<br> grid =
SWF.DataGridView()<br> grid.AutoGenerateColumns = True<br> grid.DataSource = data<br> grid.Dock = SWF.DockStyle.Fill<br> self.Controls.Add(grid)<br><br><br>if __name__ == '__main__':<br> SWF.Application.EnableVisualStyles
()<br> form = Form()<br> SWF.Application.Run(form)<br><br clear="all"><br>-- <br>Patrick K. O'Brien<br>Orbtech <a href="http://www.orbtech.com">http://www.orbtech.com</a><br>Schevo <a href="http://www.schevo.org">
http://www.schevo.org</a><br>Louie <a href="http://www.pylouie.org">http://www.pylouie.org</a>