GridViewDesigner null reference error

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I have a new control, that basically wraps a UpdatePanel and a GridView - so I can use it as a webpart. I want to expose the Gridview designer for this webpart. Is this possible? I have tried and run into various errors, since my control is not a gridview anymore...

[Designer(typeof(AspGridWebPartDesigner))]
public class AspGridWebPart : WebPart
{
GridView _AspGrid = new GridView();
UpdatePanel _UpdatePanel = new UpdatePanel();
}


public class AspGridWebPartDesigner : System.Web.UI.Design.WebControls.GridViewDesigner
{

public override void Initialize(System.ComponentModel.IComponent component)
{
AspGridWebPart aspGridWebPart = component as AspGridWebPart;
_AspGrid = aspGridWebPart.AspGrid;
_AspGrid.Site = component.Site;
base.Initialize(_AspGrid);
}


___
Newsgroups brought to you courtesy of www.dotnetjohn.com
.