2010-06-20 71 views
1

我有一個自定義類:設計問題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控件。相當方便。但是,如果我這個屬性添加到該類:

[Designer(typeof(SimpleDesigner))] 

我不明白看到了,而是一個智能標籤在我的模板填寫(也方便)。

我想在同一個智能標記中提供這兩個選項,就像使用GridView控件一樣。如何做到這一點?

回答

1

哪個是您正在使用的設計器類型?通常它會是ControlDesignerCompositeDataBoundControl您應該使用DataBoundControlDesigner類繼承您的設計器。

Grz,Kris。

+0

就是這樣,謝謝。 – 2010-06-20 16:55:58