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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:52:16+00:00 2026-05-19T04:52:16+00:00

I have a multi-paned form, in the left pane is a tree and in

  • 0

I have a multi-paned form, in the left pane is a tree and in the right pane is a Panel. Tree selections result in specific UserControls being loaded on the Panel. In this case, since the parent form is always loaded, I cannot hook into the parent form’s Shown event.

Most of my UC’s have an unbound DataGridView on them which needs to be populated when the UC is created. There can be 50,000 rows added up front at times, from an SQL Server database.

Up until now I have populated the grids during the UC constructor, but since we started working with 50,000 rows things have changed. I have found that populating the grid with 50,000 rows from the constructor takes at least 15 minutes for some crazy reason. However, if I wait to populate the grid until I click a button or from the Load event, it takes 15 seconds. This is a mystery. So I am trying to move the loading of the grid elsewhere.

When I try populating the grid from the Load event, however, there are visual inconsistencies. What happens, is you see a small version of my UC appear, it takes 15 seconds to load the DGV rows, and THEN the UC expands to fill the Panel (the UC Dock property is set to Fill). So I don’t like this option either.

The Shown event would be a perfect place to load my grid, if it existed for UC’s. Does anyone know of another way to do this?

  • 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-19T04:52:17+00:00Added an answer on May 19, 2026 at 4:52 am

    My answer to a similar problem was to populate the DGV when the grid first became visible. This is the essence of lazy-loading; get the information at the last possible second.

    Hook into VisibleChanged, which will fire when your control has Show() or Hide() called, or the Visible property manually set. If the field is currently visible, AND the control is not in the process of closing or being disposed (because for some freaky reason controls can become visible in this case), perform your grid population.

    Here’s the necessary handler, very simple:

    protected override void OnVisibleChanged(EventArgs e)
    {
        base.OnVisibleChanged(e);
    
        if (Visible && !Disposing) PopulateGridView(); //<-- your population logic
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have multi GB files coming every day to be loaded to SQL Server
I am trying to get a multi-page two-dimensional lattice panel plot to have the
More of an info question, i have a panel on the left of my
I have a multi view which contains a view which contains a panel. the
This may seem totally unreasonable to ask, but I have been designing a multi-panel,
I have a simple form with a multi line text control and Ok/Cancel buttons
We have multi-part install that needs a reboot to continue. We added a RunOnce
I'm using 'rails3-jquery-autocomplete' gem, but it doesn't have multi column search, but there is
I have a multi view application with individual UIViewControllers and xibs. I have one
I have a multi-dimensional array, which basically consists of one sub-array for each year.

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.