Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Implementing IHierarchy Support Into Your Custom Collections

, 17 Jul 2007
Brief walk-through on decorating your custom collections with the IHierarchy family of interfaces to support databinding.
using System;
using System.Collections.Generic;
using System.Web.UI;

namespace HierarchyExample {

	public class CategoryCollection : List<Category>, IHierarchicalEnumerable {

		public CategoryCollection()
			: base() {
		}

		#region IHierarchicalEnumerable Members

		public IHierarchyData GetHierarchyData(object enumeratedItem) {
			return enumeratedItem as IHierarchyData;
		}

		#endregion

	}

}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

spiegdon
Web Developer
United States United States
Scott Piegdon works full time as a Director of Quality Control for a software development company specializing Credit Union Member Services. He has experience as a Vice President of Information Technologies for a hosted ERP (Enterprise Resource Planning) company. He also runs a Web Design Services company (http://www.simplifyitwebdesign.com). He has a beautiful and wonderful wife, and two fantastic children. He loves to develop applications that others find not only easy to use and pleasing to the eye, but also provide un-surpassing functionality. He has been developing websites for over 12 years, and programming professionally for 9 of them. He has worked with dozens of database, scripting, procedural and compiled languages over the years, most recently specializing in Microsoft.Net C# 2.0 with ASP.Net backed by SQL Server 2005.
 
"Hopefully I can pass along some of the insight and knowledge I have acquired over the years to those curious enough to read it." - Scott Piegdon

| Advertise | Privacy | Mobile
Web02 | 2.8.140721.1 | Last Updated 18 Jul 2007
Article Copyright 2007 by spiegdon
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid