PDA

View Full Version : [CLOSED] Grid panel inside dynamically loaded user



CanopiusApplications
Feb 26, 2015, 11:18 AM
Hi

I have a problem very similar to this one - http://forums.ext.net/showthread.php?33351-Databinding-gridpanel-in-user-control

This occurs when when we you user control A that dynamically loads user control B using LoadControl. User control B contains a grid panel.
Note this only occurs when using a direct method and fails with an undefined control error.

Basically there is script that executes that calls App.MyStore.proxy.data =

This would work if the script called App.MyUserControlA.MyStore.proxy.data

Any idea on how I override this?

Ta,
D

CanopiusApplications
Feb 26, 2015, 11:30 AM
Ok what I ended up doing was this




ModelViewer.User_Controls.GridPopupv1 newWindow = (ModelViewer.User_Controls.GridPopupv1) LoadControl("GridPopupv1.ascx");

// SET ID TO PARENT CONTROL
newWindow.ID = "ctrlWhiteboardv1_grid" + _id.ToString();
newWindow.LoadGridControl();

_NewPan.ContentControls.Add(newWindow);

// RESET THE ID POST ADDING
newWindow.ID = "grid" + _id.ToString();

Daniil
Feb 26, 2015, 12:46 PM
Hi @CanopiusApplications,


Ok what I ended up doing was this


Please clarify do you mean that you were able to resolve the problem?

CanopiusApplications
Feb 26, 2015, 4:10 PM
Yes my hack resolved the problem although I don't think it is a solution to this problem as it might not work if the parent user control was also dynamic.

D

Daniil
Feb 27, 2015, 5:22 AM
Thanks for clarifying.

Having a test case we might investigate in greater details. Without a test case I don't quite understand what is going on.

CanopiusApplications
Feb 27, 2015, 10:30 AM
Hi D

Yup appreciate you need a test case which I will try and put together for you when I get a moment. It is a tricky one though as you need 1 aspx page, 1 parent control and 1 dynamically loaded child control placed on the parent control. The child control then needs a grid panel and this control needs to be dynamically loaded via a direct method (works if you add the control on page load).

D