Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to prevent DataGridView from repainting?

How to prevent DataGridView from repainting?

Scheduled Pinned Locked Moved C#
graphicsperformancetutorialquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jzb
    wrote on last edited by
    #1

    How to Maintains performance while rows are added to the DataGridView one at a time by preventing the control from drawing until the EndUpdate method is called?

    M J 2 Replies Last reply
    0
    • J jzb

      How to Maintains performance while rows are added to the DataGridView one at a time by preventing the control from drawing until the EndUpdate method is called?

      M Offline
      M Offline
      mark_w_
      wrote on last edited by
      #2

      SuspendLayout() ?

      1 Reply Last reply
      0
      • J jzb

        How to Maintains performance while rows are added to the DataGridView one at a time by preventing the control from drawing until the EndUpdate method is called?

        J Offline
        J Offline
        jesarg
        wrote on last edited by
        #3

        If SuspendLayout() and ResumeLayout() don't give you the performance you want, for some strange reason, setting the Visible property to false while adding rows and then changing Visible to true after you're done seems to give an even bigger performance boost. Don't ask me why, but I did a lot of testing to verify it just a few weeks ago.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups