views:

16

answers:

0

I'm extending the tellerick RadGrid control to give it an optional CustomSearchControl.

        protected override void CreateChildControls()
    {

this.Controls.Add(CustomSearchControl);

        base.CreateChildControls();

this.Controls.Add(CustomSearchControl);

    }

It seems that base.CreateChildControls() must have a clear controls call in it because the first CustomSearchControl disappears.

I tried this instead:

        protected override void CreateChildControls()
    {



        base.CreateChildControls();
this.Controls.AddAt(0,CustomSearchControl);
this.Controls.Add(CustomSearchControl);

    }

But it creates a viewstate error... as neither control is being added to the viewstate and the insert is breaking the hierarchy of the controls collection.