這可能是有點晚了回答,幸好當時我由Anders Hattestad偶然文章here。在EpiServer中擁有非常好的洞察力的多才多藝的傢伙。
我繼承了他的控制,並做了很多我自己的控制,他們的工作就像一個魅力。
謝謝。
編輯:
關於比爾的請求,這裏是最終的代碼。鏈接到文章已經放在上面:)
using System;
using System.Collections.Generic;
using System.Text;
using EPiServer.Core;
using System.Web.UI.WebControls;
using System.Web.UI;
using EPiServer.PlugIn;
using Itera.Property;
using EPiServer.SpecializedProperties;
namespace MyProject.CustomProperties
{
[PageDefinitionTypePlugIn]
public class CategoryList : PropertyMulitBase
{
public CategoryList()
: base()
{
EditOption.Add(EditOptions.ShowTopTabs, true);
}
#region BasePropertys
PropertyDataCollection basePropertys;
public override EPiServer.Core.PropertyDataCollection BasePropertys
{
get
{
if (basePropertys == null)
{
PropertyDataCollection _new = new PropertyDataCollection();
_new.Add("Category", new Category());
basePropertys = _new;
}
return basePropertys;
}
}
#endregion
}
[PageDefinitionTypePlugIn]
public class CategoryItemList : PropertyMulitBase
{
public CategoryItemList()
: base()
{
EditOption.Add(EditOptions.ShowTopTabs, true);
}
#region BasePropertys
PropertyDataCollection basePropertys;
public override EPiServer.Core.PropertyDataCollection BasePropertys
{
get
{
if (basePropertys == null)
{
PropertyDataCollection _new = new PropertyDataCollection();
_new.Add("Category Item", new PropertyPageReference());
basePropertys = _new;
}
return basePropertys;
}
}
#endregion
}
public class Category : PropertySingleBase
{
#region PropertyCollection
PropertyDataCollection innerPropertyCollection;
object lockObject = new object();
protected override PropertyDataCollection InnerPropertyCollection
{
get
{
if (innerPropertyCollection == null)
{
innerPropertyCollection = new PropertyDataCollection();
innerPropertyCollection.Add("Category", new PropertyPageReference());
innerPropertyCollection.Add("Customise", new PropertyBoolean());
innerPropertyCollection.Add("Category Item", new CategoryItemList());
}
return innerPropertyCollection;
}
set
{
innerPropertyCollection = value;
}
}
#endregion
}
}
將此項目添加到項目下的CustomProperties文件夾中。
嗨,詹姆斯,我試過你的解決方案,但不幸的是它沒有工作。不知道爲什麼。不管怎樣,謝謝 – 2012-02-09 10:34:56