Getting error on EXT:Button DirectEvents.Click.Events.

  1. #1

    Getting error on EXT:Button DirectEvents.Click.Events.

    Hi,

    I have created multiple buttons in runtime and trying to create click events for each buttons. Buttons are created but while clicking i'm getting the following error.

    "The control with ID 'btnC001' not found"

    Below are my code for your reference.

    for (int i = 0; i < dtDefects.Rows.Count; i++)
                        {
                            Ext.Net.Button btnDef = new Ext.Net.Button
                            {
                                ID = "btn" + dtDefects.Rows[i][0].ToString(),
                                Text = "<b>" + dtDefects.Rows[i][1].ToString() + "</b>",
                                Width = 140,
                                Height = 60,
                                TextAlign = ButtonTextAlign.Center
                            };
    
                            btnDef.DirectEvents.Click.Event += new ComponentDirectEvent.DirectEventHandler(btnDefClick);
                            btnDef.DirectEvents.Click.EventMask.ShowMask = true;
                            btnDef.DirectEvents.Click.EventMask.Msg = "Please wait..." + btnDef.ID;
                            
                            Ext.Net.Panel pnlGrant = new Ext.Net.Panel
                            {
                                ID = "grantPanel" + i,
                                Margins = "3 3",
                                Padding = 10,
                                Height = 80,
                                Width = 180,
                                Border = false
                            };
    
                            pnlGrant.Expand();
    
                            pnlGrant.Buttons.Add(btnDef);
                            pnlGrant.AddTo(frmPnlDefects);                                            
                        }     
    
            protected void btnDefClick(object sender, DirectEventArgs e)
            {
                try
                {
                    X.Msg.Alert("!Connect", "Hi.....").Show();
                }
                catch (Exception ex)
                {
                    X.Msg.Alert("!Connect", ex.Message.ToString()).Show();
                }
            }
    Could any one check and suggest me where I went wrong?

    Thanks in advance. :)
    Last edited by rpraj; Jul 10, 2015 at 4:21 AM.
  2. #2
    Can anybody please help me to resolve my issue...

    Thanks!
  3. #3
    Daniil,

    Could you please help me out of this.

    Thanks!
  4. #4
    Hi @rpraj,

    Welcome to the Ext.NET forums!

    This post is totally relevant to the problem that you are facing.
    http://forums.ext.net/showthread.php...l=1#post274126

Similar Threads

  1. [CLOSED] DirectEvents : DirectEvents.Click.Before Wait message always show
    By matrixwebtech in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 27, 2015, 5:08 PM
  2. Replies: 2
    Last Post: Mar 11, 2014, 6:55 AM
  3. Replies: 0
    Last Post: Jun 12, 2012, 10:00 AM
  4. Replies: 4
    Last Post: Jul 17, 2010, 8:21 AM
  5. Replies: 2
    Last Post: Jul 29, 2009, 1:57 PM

Posting Permissions