'ModelWithChildren' not found

BenTam 1,541 Reputation points

Dear All, I am learning "ObjectListView" by working with the examples (http://objectlistview.sourceforge.net/cs/blog4.html#blog-rearrangingtreelistview). However the following error is shown.

The type or namespace name 'ModelWithChildren' could not be found

Could anybody tell me how to solve it?



The source code is as follows.

using System;  
using System.Collections;  
using System.Collections.Generic;  
using System.ComponentModel;  
using System.Data;  
using System.Drawing;  
using System.Linq;  
using System.Text;  
using System.Threading.Tasks;  
using System.Windows.Forms;  
namespace TreeListViewDragDrop  
    public partial class Form1 : Form  
        public Form1()  
            // Configure the first tree  
            treeListView1.CanExpandGetter = delegate (object x) { return true; };  
            treeListView1.ChildrenGetter = delegate (object x) { return ((ModelWithChildren)x).Children; };  
            // Configure the second tree  
            treeListView2.CanExpandGetter = delegate (object x) { return true; };  
            treeListView2.ChildrenGetter = delegate (object x) { return ((ModelWithChildren)x).Children; };  
            treeListView1.Roots = ModelWithChildren.CreateModels(null, new ArrayList { 0, 1, 2, 3, 4, 5 });  
            treeListView2.Roots = ModelWithChildren.CreateModels(null, new ArrayList { "A", "B ", "C", "D", "E" });  
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,209 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Karen Payne MVP 35,031 Reputation points

    If this is for ObjectListView then you need to add a reference to your project followed by adding a using statement to form1.