Speed up displaying data in DatagridView

0
0

Hi,

I’m receiving some “complaints” from our client regarding the scroll performance of the DataGridView. The complaint is that when you scroll data past a certain amount of rows, the rows stop displaying data and instead show seemingly empty rows. If you were to wait 3 seconds the data would be presented in the datagridview.

At first I figured the server might have been busy but this is happening on my dev computer local too. Is there any setting we can change or something we can do to improve/prevent this from happening?

 

See screenshot.

 

As a side note, this also happens to the datarepeater but in a different way. Old data sometimes stay in the same (visual) rowindex while scrolling untill it’s refreshed. This is very noticeable.

Thanks,

Vincent

Attachment
  • You must to post comments
0
0

Hi Frank – we’re also experiencing this issue. The data is actually held in the DataGridView but not displayed. When we refresh a grid with say 3,000 rows (one column) a lot of rows will be blank, but it’s always the last n rows. We’re yet to replicate it consistently, but if we do, we’ll let you know.

  • vincent_
    I’ve fixed this issue by simply not using the autosize feature and instead calculate the maximum width of each cell and set that as the column width. This takes a second for the dataset I use but the scrolling issue is gone. As a benefit the user is allowed to change the column width if they want to while autosize locks it. I used drawing.measurestring to measure each dataset value per colum and set the column width to the highest value. This way also implements my opinion on autosizemode.ALLCELLS rather than all visible cells. Still, I also would like a fix for the issue as my “fix” is just a temporary solution
  • Neil Hoskins
    That’s great, thanks Vincent. We are filling the width of the grid with the column but I bet we have ‘autosize’ turned on somehow! I’ll play based on your comment – thank you.
  • Alaa (ITG)
    Hi Neil, Hi Vincent, the fix for this issue is currently in QA and it will be available in the next release! Best, Alaa
  • vincent_
    Did this get resolved in 3.1.4? I didn’t notice this report in the “current issues” section?
  • You must to post comments
0
0

Here’s a sample where it scrolls nicely up to row 100. After that the rows become blank if you scroll past row 100.

My guess would be the autosize mode of the columns.

 

  • You must to post comments
0
0

Hi Vincent,

it´s hard and close to impossible to judge what is going here by just looking at a screenshot.
How are you filling your DataGridView, is there any action performed for each row, etc.?
Can you please provide us with a test case to help us reproduce this issue?
Then we could probably help you with some hints for optimization.

Best regards
Frank

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.