1
我將tellerick RadGrid控件擴展爲可選的CustomSearchControl。RadGrid覆蓋CreateChildControls
protected override void CreateChildControls()
{
this.Controls.Add(CustomSearchControl);
base.CreateChildControls();
this.Controls.Add(CustomSearchControl);
}
似乎base.CreateChildControls()必須有明確的控制調用它,因爲第一CustomSearchControl消失。
我嘗試這樣做,而不是:
protected override void CreateChildControls()
{
base.CreateChildControls();
this.Controls.AddAt(0,CustomSearchControl);
this.Controls.Add(CustomSearchControl);
}
但它創建一個視圖狀態錯誤...既不控制被添加到視圖狀態和刀片更是打破了控件集合的層次結構。