OnEditCommand of DataGrid does not fire
Hi all,
I have a weir problem with dataGrid. I using the same technique for different project but this one does not work. The function that bind to OnEditCommand is never fired. Pelase help.
John
<asp:DataGrid ID="SearchList"
Runat="Server" Width="100%"
AutoGenerateColumns="false"
AlternatingItemStyle-BackColor="#DCDCDC"
OnEditCommand="SearchList_GetRecord">
<Columns>
<asp:BoundColumn HeaderText="Heat Code" DataField="Heat_code"></asp:BoundColumn>
<asp:BoundColumn HeaderText="Carbon Equiv" DataField="CARBON_EQUIV"></asp:BoundColumn>
<asp:EditCommandColumn ButtonType="LinkButton" EditText="Edit" UpdateText="UpDate" CancelText="Cancel"></asp:EditCommandColumn>
</Columns>
</asp:DataGrid>
on my .cs file,
// This function never fire when I click on the edit link. Why??????
protected void SearchList_GetRecord(object sender, System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
string a = e.Item.Cells[1].Text;
}
|