locked
CF3.5 TreeNodeCollectionEditor issue when using inheritance RRS feed

  • Question

  • Hello everyone,

      I have implemented a UserControl that has an embedded TreeView in it. When I try to modify the exposed "Nodes" property of the TreeView in the Visual Studio Designer, I get an error from Visual Studio:

    ---------------------------
    Microsoft Visual Studio
    ---------------------------
    Object reference not set to an instance of an object.
    ---------------------------
    OK  
    ---------------------------

      I expose the "Nodes" property in the following way:

    public class MyControl : UserControl
    {
      private TreeView m_innerTreeView;

      public TreeNodeCollection Nodes
      {
        get { return this.m_innerTreeView.Nodes; }
      }

      (...)
    }

      Any ideas? The interesting thing is that this issue won't happen in a Win32 project. Only when working with the CF.

    Thanks a lot.
    Regards
    Carlos

    Friday, January 15, 2010 5:14 PM