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 357275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T12:11:25+00:00 2026-05-12T12:11:25+00:00

What is the best way to display, in a web part, dynamic tables where

  • 0

What is the best way to display, in a web part, dynamic tables where each cell can cause a postback to display a different set of data?

For example, imagine some financial data:

Table 1:  Quarters in year

         |   Q1  |  Q2  |  Q3  |  Q4  |
Things 1 |   23  |  34  |  44  |  32  |
Things 2 |   24  |  76  |  67  |  98  |

On clicking on the value for Q2, Things 1 (34), this will lead to a second table being displayed instead of Table 1:

Table 2:  Weeks in Quarter

            |   W1  |  W2  |  W3  |  W4  |  W5  |  W6  |  W7  |
SubThings 1 |   231 |  22  |  44  |  22  | 344  |  86  |  12  |
SubThings 2 |   14  |  75  |  47  |  108 | 344  |  86  |  12  |

The problem with the approach I am taking at the moment is that I can create Table 1 in CreateChildControls, which leads to all the events being wired up fine for all the linkbuttons in the cells.

However, because on the postback, I need to create Table 1 in CreateChildControls again, in order to have the eventhandlers correctly wired up, and as the events fire after CreateChildControls, I only know that I need to change the table after CreateChildControls.

Thus, wherever I create Table 2 as a resault (since its after CreateChildControls), I cant get it to wire up events correctly.

Any thoughts?

Regards
Moo

Edit: Solved it.

What you need to do is check in OnPreRender any eventhandler calls, set any flags you need to and then call this.CreateChildControls manually so the new table is created and everything is wired up correctly.

  • 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-12T12:11:25+00:00Added an answer on May 12, 2026 at 12:11 pm

    At Alex’s suggestion, here is the answer:

    The events need to be tied up prior to them being called, so you need to create the same control in CreateChildControls, allow the event to be called and then resetup everything afterward.

    To do this, first do CreateChildControls identically to the prior page, then check in OnPreRender if any eventhandler calls have been made, set any flags you need to and then call this.CreateChildControls manually with the new setup information so the new table is created and everything is wired up correctly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What is the best way to display multidimensional data in WPF? I won't know
Can anyone suggest the best way to display a Textblock (with a text such
What is the best way to display results and data coming from Database in
What is the best way to display a large chunk of text (taken from
What would be the best way to display a dialog whenever my app receives
Any suggestions on the best way to display this table on an Android platform?
I'm trying to figure out the best way to display a long list of
What's the best (and easy) way to display any loading icon (rotating wheel, screen
We currently have a product that uses Sharepoint and a number different Web Part
Possible Duplicate: What's the best way to display an image from a sql server

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.