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(&#39;System.Windows.Forms&#39;)<br>clr.AddReference(&#39;System.Drawing&#39;)<br><br>import System.Windows.Forms as WinForms<br>
import System<br>from System.Drawing import Size, Point<br><br>SAMPLE_DATA = [<br>(&#39;Joe&#39;, 23),<br>(&#39;Bob&#39;, 8),<br>(&#39;Thomas&#39;, 32),<br>(&#39;Patrick&#39;, 41),<br>(&#39;Kathy&#39;, 19),<br>(&#39;Sue&#39;, 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&quot;DataGridView From Python&quot;<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>