Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3403638
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T05:17:07+00:00 2026-05-18T05:17:07+00:00

I have developed an asp.net control that inherits from the gridview and its called

  • 0

I have developed an asp.net control that inherits from the gridview and its called gridviewex… i need some page navigation stuff to render underneath it for some custom paging that i am implenting.. All going well but i can’t seem to add new controls to the controls..

For example what i wanted to do is add a asp.net Panel underneath the grid and than add linkbuttons to the panel.

I have this so far but it gives an error

  Unable to cast object of type 'System.Web.UI.WebControls.Panel' to type 
  'System.Web.UI.WebControls.Table'.

The code..

    protected override void OnPreRender(EventArgs e)
    {
        base.OnPreRender(e);

        Panel uxGridViewNavigation = new Panel();

        LinkButton linkButton = null;

        linkButton = new LinkButton();
        linkButton.Text = "First";
        linkButton.Click += new EventHandler(linkButton_Click);

        uxGridViewNavigation.Controls.Add(linkButton);

        this.Controls.Add(uxGridViewNavigation);

     }

I would really appreciated any help. Its my first server control extension 🙂

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T05:17:08+00:00Added an answer on May 18, 2026 at 5:17 am

    Override Render like:

    override Render(HtmlTextWriter writer)
    {
        // outputs all the inner magic of your grid
        base.Render(writer);
    
        Panel panel = new Panel();
        // do magic
    
        // now also render the panel to the writer
        panel.RenderControl(writer);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have developed an asp.net application that has a Gridview control. I want it
I have developed an ASP.NET MVC 2 website, and now need to deploy it
I have developed a site using ASP.NET 3.5, located within a virtual directory that
We have an ASP.NET application that uses the Infragistics WebSchedule control to display appointments
I have developed a server control inherited from WebControl that wraps any number of
I have a website developed in ASP.Net 2.0 that is throwing the error Exception
I have developed an ASP.Net (VB.Net) website which is using Entity Framework and SQL
I have developed an ASP.NET MVC (version 2 RC) application with a ton of
I have developed a site with ASP.NET MVC 1, and now I'm trying to
i have developed a web application asp.net C#. on a button click i am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.