ItemCommand does not fire

  • Thread starter thijs braem via .NET 247
  • Start date
T

thijs braem via .NET 247

hi, this problem is driving me nuts:

My page contains a dynamically built datagrid, which in turncontains a ButtonColumn meant to allow the user to edit aparticular record in a new detail page.
Now, no matter what I try, the ItemCommand event never getsfired. I found on other messageboards tips to add an invisiblebound column, turn on or off the viewstate for the datagrid, oruse a pushbutton instead of a linkbutton, but none of thathelped a thing.

Is this a bug, or did I miss something here? Please say so if Ididn't provide enough information...

//THE BUTTON COLUMN THAT IS ADDED TO THE DATAGRID
ButtonColumn bclEditView = new ButtonColumn();
bclEditView.ButtonType =System.Web.UI.WebControls.ButtonColumnType.PushButton;
bclEditView.CommandName = "EditView";
bclEditView.Text = "Edit/View";
bclEditView.HeaderText = "Edit/View";

//INITIALIZECOMPONENT
private void InitializeComponent()
{
this.btnNewRequest.Click += newSystem.EventHandler(this.btnNewRequest_Click);
this.dgrAll.ItemCommand += newSystem.Web.UI.WebControls.DataGridCommandEventHandler(this.dgrAll_ItemCommand);
this.dgrAll.SelectedIndexChanged += newSystem.EventHandler(this.dgrAll_SelectedIndexChanged);
this.Load += new System.EventHandler(this.Page_Load);
}

//WHAT SHOULD HAPPEN WHEN A BUTTON IS CLICKED (debugger nevergets here...)
private void dgrAll_ItemCommand(Object sender,DataGridCommandEventArgs e)
{
this.AddResponseLine("button clicked!");
}


thanks for any response,
thijs
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top