简体   繁体   中英

How many rows a normal C# window form application can load easily in datagridview

I am using datagridview for data rendering in window form application. application is actually fetching a lot of rows and the system gets stuck and goes to not responding state. it is normally getting 100K + rows. How many rows a normal C# window form application can load easily in datagridview

I'm not aware of any hard limitations. This would be based on factors like the amount of resources available to the application. If you're rendering high amounts of data, you may want to consider using virutal mode. https://docs.microsoft.com/en-us/dotnet/framework/winforms/controls/implementing-virtual-mode-wf-datagridview-control

I don't think its good idea to first of fetch 100k+ rows and show all on grid, use can use paging that will be quicker and more efficient. You can control how many records you want to fetch at once based on traffic and performance of your database.

@pageNumber AS INT,
@rowsPerPage AS INT,

OFFSET((@PageNumber -1) * @RowsPerPage) ROWS
FETCH NEXT @RowsPerPage ROWS ONLY;
GO

Read this article : https://10tec.com/articles/why-datagridview-slow.aspx

I have analysed the application and found out that there is nothing wrong with the datagridview. it can contain 100K rows if required. there are some other functions that executes once the data loads which takes lot of time and puts the application in not responding state. Virtual mode and Paging are also good options. And I agree with your points that 100K rows are too much for a human to process. thats just the wastage of resources and effort. I understand that. I am actually trying to improve someone else's application. Thanks guys !

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM