Jul 09, 2015, 12:12 PM
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.
Thanks in advance. :)
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.