Flickering during updates to Controls in WinForms (e.g. DataGridView)

前端 未结 8 1735
悲哀的现实
悲哀的现实 2021-01-05 10:43

In my application I have a DataGridView control that displays data for the selected object. When I select a different object (in a combobox above), I need to update the grid

8条回答
  •  借酒劲吻你
    2021-01-05 11:32

    Rather than adding the rows of the data grid one at a time, use the DataGridView.Rows.AddRange method to add all the rows at once. That should only update the display once. There's also a DataGridView.Columns.AddRange to do the same for the columns.

提交回复
热议问题