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 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.
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.
WebDataGride has properties, AutoGenerateColumns="True", EnableViewState = "True"
Hi bhadresh,
I freezed the column in InitializeRow when row index is 0. Also have a button to refresh WebDataGrid control.
First, when the button clicked, WebDataGrid is binded and freezed the columns. The memory is fine, but when I click this button to rebind WebDataGrid again, I will see the memory was going up and got outof memory exception.
My environ is 2010 vol. 3 and IE 8. Visual Studio 2010.
I saw your code, it's a little different, I freezed the column in InitializeRow, instead of page load. I also did other test. Like, I freezed the column in design mode, if I don't click freeze icon, and click the refresh button, the memory is fine, but if the column is freeze when click the icon, and clicked refresh button, then the memory is running out.
Any idea, is it version issue?
My version is 2010 vol. 3