GridViewDesigner null reference error

Discussion in 'ASP .Net Datagrid Control' started by Sahil Haslani, Mar 6, 2007.

  1. 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
    Sahil Haslani, Mar 6, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. blash
    Replies:
    6
    Views:
    601
    Ken Dopierala Jr.
    Dec 29, 2004
  2. Steve Richter

    confused about null reference compile error

    Steve Richter, Apr 26, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    3,085
    Steve Richter
    Apr 26, 2005
  3. ¿À¼º¿µ
    Replies:
    1
    Views:
    567
    Steve C. Orr [MVP, MCSD]
    Feb 9, 2006
  4. Replies:
    5
    Views:
    26,481
    Mike Schilling
    Mar 29, 2006
  5. Cirene
    Replies:
    1
    Views:
    797
    Alexey Smirnov
    Jun 9, 2008
Loading...

Share This Page