Hi,
I have a webdatagrid and want to freeze the column in code behide. The first time when grid binded , the memory was up from 2.33GB to 2.34GB in task manager, but when I refreshed this control and binded again, I saw the memroy is going up to 3.41GB, and got this exception.
Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Exception of type 'System.OutOfMemoryException' was thrown.
The issue is caused by this code.
this.wdgGridView.Behaviors.ColumnFixing.FixedColumns.Add("Select", FixLocation.Left);
If I don't freeze the column, the memory is fine whatever how many times to bind, but when I freezed one column, the issue is happened.
If I reload whole page, it's fine, but I don't want to do that, I only want to refresh the webdatagrid in updatepanel only.
BTW, if I set EnableViewState is false, that will be fine, but if true, I will get this issue again. I want to keep EnableViewState is true.
WebDev.webServer40.ExE*32 was running out of memory.
Thanks,
Michael
Hello Michael,
I have used the line of code you have provided to reproduce the memory leak issue you described. I was not able to reproduce this behavior. I have attached mark and code behind I have used to test this behavior. I have tested this sample using Windows 7, NetAdvantage version 11.1.20111.2043, IE 8, and Visual Studio 2010.
If this sample project is not an accurate demonstration of what you're trying to do, please feel free to modify it and send it back.
WebDataGride has properties, AutoGenerateColumns="True", EnableViewState = "True"
I have modified the sample I have provided based on details you have provided. I have used NetAdvantage version 2010.3 service releases. I fixed column in “initializeRow” event as shown below:
if (e.Row.Index == 0){this.WebDataGrid1.Behaviors.ColumnFixing.FixedColumns.Add("NumCol", FixLocation.Left);}
I was not able to reproduce any memory leak issue. I have attached modified mark up and code for you to review. I have tested this sample using Windows 7, NetAdvantage version 10.3.20103.2173, IE 8, and Visual Studio 2010.
If you are using NetAdvantage 2010.3 build version (10.3.20103.1013), I would suggest you to download latest service release and upgrade your project to that service release.
Hope this helps.
I am following up to see if you were able to test the issue you described using the code snippet I have provided.
Let me know if you need any further assistance.