设计问题CompositeDataBoundControl [英] Designer problem with CompositeDataBoundControl
问题描述
我有一个自定义类:
SimpleTemplatedControl : CompositeDataBoundControl
private ITemplate _itemTemplate;
[PersistenceMode(PersistenceMode.InnerProperty),
TemplateContainer(typeof(SimpleItem)),
]
public ITemplate ItemTemplate
{
get { return _itemTemplate; }// get
set { _itemTemplate = value; }// set
}
protected override int CreateChildControls(
System.Collections.IEnumerable dataSource,
bool dataBinding)
{
//
}
当我把这个上一个WebForm我得到这样一个智能标签中,我可以选择的 DataSource控件。 pretty方便易。但是,如果我这个属性添加到该类:
When I drop this on a webform I get such a smart tag in which I can choose a DataSource control. Pretty convinient. However if I add this attribute to this class:
[Designer(typeof(SimpleDesigner))]
我不明白看到了,而是一个智能标签在我的模板填写(也方便)。
I don't get to see that anymore but instead a smart tag to fill in my Template (also handy).
我想有可从同一智能标签内就像一个GridView控件两个选项。如何做到这一点?
I would like to have both option available from within the same smart tag just like with a GridView control. How to accomplish this?
推荐答案
这是你使用的设计类型?通常情况下这将是的 ControlDesigner 的,但对于的 CompositeDataBoundControl 的,你应该使用 DataBoundControlDesigner 类来继承你的设计师。
Which is the Designer type you're using? Normally it would be ControlDesigner but for the CompositeDataBoundControl you should use the DataBoundControlDesigner class to inherit your designer from.
GRZ,克里斯。
这篇关于设计问题CompositeDataBoundControl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!