title: Visual studio 2013 properties window datasource
body: <p>I'm having trouble selecting the datasource for a datagridview inside the properties window. It worked for the first seven datagridviews, but now suddenly, an error message pops up every time I click the dropdown sign:</p>
  
  <blockquote>
    <p>object reference not set to an instance of an object. </p>
  </blockquote>
  
  <p>After restarting visual studio and trying again, an error message pops up:</p>
  
  <blockquote>
    <p>Root element is missing.</p>
  </blockquote>
  
  <p>On the second try the drop down menu works and I can choose an object, but after choosing an warning message pops up: </p>
  
  <blockquote>
    <p>Property value is not valid.</p>
  </blockquote>
  
  <p>details:</p>
  
  <blockquote>
    <p>"Unable to cast object of type 'System.Windows.Forms.PropertyManager' to type 'System.Windows.Forms.CurrencyManager'. </p>
  </blockquote>
  
  <p>After that it throws the first error message again every time I click the datasource dropdown menu. It does so for every datasource property in the entire solution.</p>
  
  <p>I hope somebody can help me.</p>
  
  <p>I even tried reinstalling visual studio.</p>
  
  <p>All the Code:</p>
  
  <p>MainForm.cs:</p>
  
  <pre><code>using System;
  using System.Windows.Forms;
  using Database;
  
  namespace MainProject
  {
      public partial class MainForm : Form
      {
          public MainForm()
          {
              InitializeComponent();
          }
      }
  }
  </code></pre>
  
  <p>Program.cs:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Threading.Tasks;
  using System.Windows.Forms;
  
  namespace MainProject
  {
      static class Program
      {
          /// &lt;summary&gt;
          /// The main entry point for the application.
          /// &lt;/summary&gt;
          [STAThread]
          static void Main()
          {
              Application.EnableVisualStyles();
              Application.SetCompatibleTextRenderingDefault(false);
              Application.Run(new MainForm());
          }
      }
  }
  </code></pre>
  
  <p>MainForm.Designer.cs is to big to add here.</p>