Problem on rasing DirectEvent on Desktop control.

  1. #1

    Problem on rasing DirectEvent on Desktop control.

    Hi Ext

    At first thanks so much about Ext components. I'm appreciated.
    I'm adding a dynamic module into my desktop control but I have problem on raising DirecEvents. My code is

        [DirectMethod(ShowMask = true)]
        public void AddAnotherModule()
        {
            Desktop.GetInstance().RemoveModule("add1-module");
    
            var win = new Window
            {
                Title = "Dynamic Window",
                Width = 300,
                Height = 300,
                DefaultRenderTo = Ext.Net.DefaultRenderTo.Form,
                Icon = Icon.ApplicationAdd
            };
    
            DesktopModule m = new DesktopModule
            {
                ModuleID = "dyn-mod",
                Shortcut = new DesktopShortcut
                {
                    Name = "Dynamic Module"
                },
    
                Launcher = new Ext.Net.MenuItem
                {
                    Text = "Dynamic module"
                },
    
                Window =
                {
                    win
                },
    
                AutoRun = true
            };
    
            var btn = new Ext.Net.Button
            {
                Text = @"DynamiC Button"
            };
        
            btn.DirectEvents.Click.Event += OnClick;
            m.Window[0].Items.Add(btn);
    
            Desktop1.AddModule(m);
        }
    
        protected void OnClick(object sender, DirectEventArgs e)
        {
            X.Msg.Alert("OnClick", "DirectEventArgs");
        }
    Why Click event of DirectEvents raising this error and it can not find my Button control?

    Error message is "The control with ID 'button-1066' not found".
    Last edited by ArashRahimian; Apr 22, 2018 at 6:24 PM.

Similar Threads

  1. [CLOSED] Lazy loading of User control has problem with DirectEvent
    By dannyrih in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Oct 08, 2013, 4:28 PM
  2. Replies: 6
    Last Post: May 30, 2013, 5:49 AM
  3. Replies: 18
    Last Post: Jul 12, 2012, 6:36 AM
  4. Replies: 32
    Last Post: Jan 11, 2011, 9:53 AM
  5. Refreshing desktop control from desktop window
    By AnilVelamuri in forum 1.x Help
    Replies: 0
    Last Post: May 26, 2010, 7:53 AM

Tags for this Thread

Posting Permissions