Gustav Brock
Gustav at cactus.dk
Wed Jan 26 04:03:24 CST 2011
Hi Shamil If "several seconds" is the time it takes to read the data from the Access database, it has to happen. And you do so in the background in a separate thread when you open the form and expect the form to be "live" while that happens. However, the form is dimmed or non-responsive until data has been loaded. Couldn't you try - when you open the form - to fill the DataGridView with one or few dummy records and then - when data is loaded - to switch to the real source? However, if this function is used only rarely and the retrieval only lasts for some seconds, I think I would just pop a message box: Please wait ... /gustav >>> shamil at smsconsulting.spb.ru 25-01-2011 17:33 >>> Hi All -- I have a .NET WinForm app with a DataGridView bound to an ADO.NET dataset getting data from MS Access/JET backend table. And I'd like to have my WinForm beeing *non-blocked* while loading that DataGridView with 120,000+ rows from an MS Access backend table. I do fire DataGridView data loading via TimerControl Tick event then run it via BackgroundWorker, I do use SuspendLayout etc. still as far as I see WinForm gets blocked for several seconds: - first when dataset's rows are retrieved, - second when DataGridView gets bound to retrieved dataset. Do you know about/have you seen somewhere any tricks how to make such a large data set loading non-blocking WinForm? It's not a big issue after all - I just wanted to make it working even more smoothly than it does work now - somehow like MS Access datasheets when they load data asynchronously... Of course using 120,000+ rows for a DataGridView is a questionable solution but that's a customer requirement: that much records they get in an year (then they archive/clear backend table and start from scratch) - and filtering that 120,000+ rows when they are loading happens almost instantly - so the only issue is initial loading/refreshing - the latter doesn't happen often... Thank you. -- Shamil