StrataFrame Forum

CurrentDataTable not changed / ASPxGridView

http://forum.strataframe.net/Topic30670.aspx

By ChanKK - 11/30/2011

Hi
As anyone who follow my previous post, might notice that I am facing memory leak issue when bind BO to ASPxGridView via WebBusinessBindingSource.
I found the workaround by change SF source code to auto dispose the internal BBS in Unload event. I tested it with ANTS memory profiler and found that the memory leak issue solved.

However, I have another issue here. I have attached a sample project. It is using Northwind db. 
The project UI consist of 2 gridview, upper one is using ParentBO (EmployeesBO), and the bottom one is using childBO  (EmployeeTerritoriesBO). WHen ParentBO.Navigated, childBO will be refilled.

1. Run the web app
2. Key in any firstname in the list, and click "FILL" button. 
3. The child ASPxGridview is refreshed correctly.
4. Repeat step 2 with another first name again.
5. The child ASPxGridView will not refreshed anymore. It will always show the result when do the first time query.

Any ideas?

Thank you
By Andrew Harper - 11/30/2011

Hi Chan,

Is the child BO being re-populated in a callback from the aspx page?

If so you will need to refresh the child grid in client-side javascript on completion of the callback. I faced a similar situation in our app where I had a parent grid and a child grid and was using (if I remember correctly)  the server side onselectionchanged event of the parent grid to repopulate the child BO.

Unfortunately I am not in a position to look at my code or yours until tomorrow but will do so if you haven't found solution by then.

Hope this helps,

Best regards,

Andy
By ChanKK - 11/30/2011

Hi
It is postback, so should not be the same scenario. Additionally, I do call childGrid.DataBind()
Thank for reply.
By Andrew Harper - 12/1/2011

Hi Chan,

I downloaded your sample and did the following:

1. Opened and converted project in VS2010, I did not update the project to use a newer .net target platform

2. Changed the Microfour References to the Microfour dll's you supplied. The solution would then build without error

3. Changed the Global.asax to point to my Northwind DB 

4. Built the solution

5. Ran the application and got the error below:



Method not found: 'MicroFour.StrataFrame.Business.BusinessBindingSource WBBSEnumerator.get_BBS()'.

Source File: C:\chank\NotRefresh\Common\BaseWBBS.cs    Line: 49 



6. Modified BaseWBBS and commented out the code below base.OnUnload(e)



public class BaseWBBS : MicroFour.StrataFrame.UI.Web.WebBusinessBindingSource

{

#region " Private Fields "

private bool _autoDispose = true;

#endregion

#region " Public Properties "

/// <summary>

/// Method to set gridview to auto dispose datasource

/// </summary>

public bool AutoDispose

{

get

{

return this._autoDispose;

}

set

{

this._autoDispose = value;

}

}

#endregion

protected override void OnUnload(EventArgs e)

{

base.OnUnload(e);

/*

if(this.AutoDispose && this.DataView != null

&& this.DataView.CurrentEnumerator.BBS != null)

{

this.DataView.CurrentEnumerator.BBS.Dispose();

}

*/

}

}

}



7. Rebuilt and ran the application and the clicking on the fill button worked as expected,

I suspect the initial error is due to a different strataframe dll being picked up at run time on my machine, however the fix suggests to me that the issue is with your version. 

Hope this helps,

Andy

ps. The format change in this post from point 6 onwards is unintentional - I tried but couldn't overcome it in the editor!

By ChanKK - 12/1/2011

HiI have modified the SF source code. In fact, you should not hit this error with my shipped SF dll. Anyway, I attached the modified CS file, please backup ur SF source code, and update with mine. Recompile it and run again (register to GAC if necessary). Thank you

Edited: BTW, do you have any memory profiler that can check if the app cause memory leak? If yes, shall you please turn the "autodispose" to false and see if memory leak happen. In my profiling, I found it happens, but SF team can't detect it. I would like to know if I have done mistakes so that I can correct it. Thank you