Calling Method from Control not Fully Running
(Using Teleriks' RadPageView)
I have a Method inside a usercontrol which creates and populates a "RadPageView".
public void CreateDemoMap()
{
RadPageViewPage pTest = new RadPageViewPage();
pTest.Text = "Live Map (Demo)";
radPageViewX.Pages.Add(pTest);
WebMap wMap = new WebMap();
pTest.Controls.Add(wMap);
MessageBox.Show("TEST");
}
From the same form but outside of the user control I have a button calling on the Method.
private void radButtonElement4_Click_(object sender, EventArgs e)
{
ProjectDashControl PDC = new ProjectDashControl();
PDC.CreateDemoMap();
}开发者_JAVA技巧
The method does run (Textbox Shows "Test") But the RadPageView does not generate.
Running the method localy - I get the intended results and it works fine.
public ProjectDashControl()
{
InitializeComponent();
CreateDemoMap();
}
Suggestions? Thank-you in Advance!
Had to move Variable ProjectDashControl PDC to Global Scope and Change to Instance.
ProjectDashControl PDC = ProjectDashControl.Instance();
精彩评论