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

  • Home
  • SEARCH
  • 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 8274737
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T07:50:02+00:00 2026-06-08T07:50:02+00:00

I have an unbound datagridview view. The first load always runs very fast but

  • 0

I have an unbound datagridview view. The first load always runs very fast but the second load is about 20 times slower.

I do the following everytime and if I remove this code the second and subsequent loads are fast (unfortunately I must keep this color logic):

            for (int ri = 0; ri < pdgv.Rows.Count; ri++)
            {
                for (int ci = 0; ci < pdgv.Columns.Count; ci++)
                {
                    if (pdgv.Columns[ci].Frozen)
                    {
                        pdgv[ci, ri].Style.BackColor = v.Frozen_BackColor;
                        pdgv[ci, ri].Style.ForeColor = v.Frozen_ForeColor;
                        pdgv[ci, ri].Style.Font = v.Frozen_Font;
                        if (pdgv[ci, ri].OwningColumn.Name.StartsWith("yn_") &&
                            pdgv[ci, ri].Value != null &&
                            pdgv[ci, ri].Value.ToString() == "1")
                        {
                            pdgv[ci, ri].Style.BackColor = Color.Red;
                            pdgv[ci, ri].Style.ForeColor = Color.White;
                        }
                    }
                    if (pdgv.Columns[ci].ReadOnly)
                    {
                        pdgv[ci, ri].Style.BackColor = v.ReadOnly_BackColor;
                        pdgv[ci, ri].Style.ForeColor = v.ReadOnly_ForeColor;
                        pdgv[ci, ri].Style.Font = v.ReadOnly_Font;
                    }
                }
            }
  • 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-06-08T07:50:04+00:00Added an answer on June 8, 2026 at 7:50 am

    I dispose and rebuild the datagridview before loading the second time and it is as fast as the first load.

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

Sidebar

Related Questions

I have a DataGridView in a Winforms app that has about 1000 rows (unbound)
Referring to the first answer about python's bound and unbound methods here, I have
I have a unbound DataGridView with two columns. First column is just string values.
On a Windows form I have an unbound datagridview with 1 user-editable column. A
I'm using c#2.0 and WinForms. I have a datagridview control, unbound, loading small amounts
I have a datagridview (unbound). Fields are Name, Family Name and Phone No and
I have few columns in my DataGridView, one of them is an unbound column
I have a form created which an unbound datagridview that has three columns. Position,
I am using 3 unbound DataGridView controls to display certain information. To load the
I have a DataGridView with unbound data that contains three different DataColumns . The

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.