Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
315
Databinding and Memory Leak
posted

Create a custom class, and define a collection for it i.e. BindingList(Of CustomClass). Initialize this and keep it in a vb.net module

On a form,  lets call it Form1, put a Grid on it and in Form Load set the datasource to the CustomCollection in the module. On Form 1 also put a button, onclick on which Form2 is opened

Create another form, Form2, there also put a Grid and in Form Load set the datasource to the same Custom Collection in the module.

 

Now open Form1:

click on the button - this will open Form2, in the load of which grid.datasource = customcollection gets executed. Then close Form2 without doing anything else on it. Repeat this step a few times. You will notice that after each button click the time taken to open Form2, keeps increasing progressively.

 

I have tested the same on a WIndows DataGrid, it works fine. Repeated clicks on the button in Form1, opens up Form2 right away without any delay


Can you suggest what might be going on

 

 

 

Parents Reply Children
No Data