title: Creating and Populating a Porperty Grid - Iron Python
body: <p>I am creating an Iron Python application that reads settings from an xml. It will also allow the user to saves out settings to an xml file.</p>
  
  <p>I have to use Iron Python. I looked and tried to use the DataGridView to accomplish this, but I think the Property Grid is my best option (please let me know if there is a better way to create a simple settings table). </p>
  
  <p>I added the property grid to the form, and now I do not know how to add the data to it. I tried using this example:
  <a href="http://msdn.microsoft.com/en-us/library/aa302326.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/aa302326.aspx</a></p>
  
  <p>However, that is in C#. I am not sure what I am doing wrong:</p>
  
  <pre><code>class MainForm(Form):
      def __init__(self):
          self.InitializeComponent()
          appset = AppSettings();
          self._propertyGrid1.SelectedObject = appset
  
      def InitializeComponent(self):
          self._propertyGrid1 = System.Windows.Forms.PropertyGrid()
  
  class AppSettings(self):
      def __init__(self):
          saveOnClose = True
      def saveOnClose(self):
          return self.saveOnClose
  </code></pre>