开发者

Calling Method from Control not Fully Running

开发者 https://www.devze.com 2023-03-13 08:29 出处:网络
(Using Teleriks\' RadPageView) I have a Method inside a usercontrol which creates and populates a \"RadPageView\".

(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();
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号