If this is for ObjectListView then you need to add a reference to your project followed by adding a using statement to form1.
'ModelWithChildren' not found
BenTam
1,561
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?
TIA
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()
{
InitializeComponent();
// 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" });
}
}
}