With Ironpython 2.7 the following code works. Not so with python for .Net where only a blank Form is displayed.<br>Used python for .Net is compiled from trunk of May 26, 2012 python 2.6 and clr4.<br><br>Any help is appreciated.<br>
<br>Cheers<br>Manfred<br>#-------------------------<br><br>import clr<br><br>clr.AddReference('System.Windows.Forms')<br>clr.AddReference('System.Drawing')<br><br>import System.Windows.Forms as WinForms<br>
import System<br>from System.Drawing import Size, Point<br><br>SAMPLE_DATA = [<br>('Joe', 23),<br>('Bob', 8),<br>('Thomas', 32),<br>('Patrick', 41),<br>('Kathy', 19),<br>('Sue', 77),<br>
]<br><br>class Person(System.Object):<br> def __init__(self, name, age):<br> self.Name = name<br> self.Age = age<br><br>people = []<br>for name, age in SAMPLE_DATA:<br> people.append(Person(name, age))<br>
<br>f=WinForms.Form()<br>f.Text = u"DataGridView From Python"<br>h = WinForms.SystemInformation.CaptionHeight<br>fdgv=WinForms.DataGridView()<br>fdgv.AutoSize = True<br>fdgv.Dock = WinForms.DockStyle.Fill<br>fdgv.DataSource = people<br>
fdgv.Refresh()<br>f.Controls.Add(fdgv)<br>WinForms.Application.Run(f)<br><br>