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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:44:39+00:00 2026-05-25T06:44:39+00:00

I have a user control that often has 2000 or so component controls (TextBoxes,

  • 0

I have a user control that often has 2000 or so component controls (TextBoxes, TextBlocks, ComboBoxes, etc.), and my application doesn’t run as fast as I’d like.

While 2000 controls may seem like a lot at first, it is really only representative of a WPF data grid that has 10 columns and 200 rows – a common scenario in many applications.

Here’s an extremely simple sample that I believe mimics such a data grid, and I’m seeing a 200ms or so render time:

public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();
        Loaded += MainWindow_Loaded;
    }

    void MainWindow_Loaded(object sender, RoutedEventArgs e)
    {
        Stopwatch stopwatch = Stopwatch.StartNew();

        ScrollViewer scrollViewer = new ScrollViewer();
        StackPanel stackPanel = new StackPanel();

        for (int rowIndex = 0; rowIndex < 200; rowIndex++)
            for (int columnIndex = 0; columnIndex < 10; columnIndex++)
                stackPanel.Children.Add(new TextBlock { Text = Guid.NewGuid().ToString() });

        scrollViewer.Content = stackPanel;
        this.Content = scrollViewer;

        UpdateLayout(); // Force a UI layout so we can get an accurate stopwatch reading
        MessageBox.Show(stopwatch.Elapsed.ToString(), "UI Layout Time");
    }

This is as simple as I can think to make this example, but 200 ms is still enough for a user to notice and potentially think the software is slow.

If this were a real control with a data grid, the controls would be very likely be more complex than TextBlocks and potentially have further time sucks like IValueConverters and Styles / DataTemplates.

Is there anything I can do to speed up the load time of controls that have a lot of data?

  • 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-25T06:44:40+00:00Added an answer on May 25, 2026 at 6:44 am

    Check the concept: UI Virtualization. It should help if you don’t have too much controls on viewable area.

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

Sidebar

Related Questions

I have a user control that is pretty basic. It contains several TextBox controls,
I have a user control that has a few public properties, one is an
I have a user control that contains a collection of controls to be reused
I have a user control that contains a GridView. The GridView has both a
I have a user control that has the following overridden event: protected override void
I have a user control that I'm building. It's purpose is to display the
i have a user control that descends from UserControl. When dropped onto the form
I have a user control that I've created, however when I go to add
I have a user control that takes a several seconds to load. Is there
I currently have a user control that is used on both an /Address/Edit and

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.