Hello all --
Making a first shot at adding an edit column through code, and can't seem to get the event handler to fire.
The following is my datagrid declaration:
and here's the code that adds the edit column:
However, the DataGrid_Edit function is not fired when someone clicks the edit button. However, it is fired if I add it like so to the declaration:
Anyone see what I'm doing wrong here? What must I do to wire the event up?
Thanks!
paul
Making a first shot at adding an edit column through code, and can't seem to get the event handler to fire.
The following is my datagrid declaration:
Code:
<asp:datagrid id="dgUsers" runat="server" OnEditCommand="DataGrid_Edit" OnDeleteCommand="DataGrid_Delete" />
Code:
Dim editColumn As New System.Web.UI.WebControls.EditCommandColumn()
editColumn.HeaderText = "Edit"
editColumn.EditText = "Edit"
editColumn.ButtonType = ButtonColumnType.LinkButton
dgUsers.Columns.Add(editColumn)
However, the DataGrid_Edit function is not fired when someone clicks the edit button. However, it is fired if I add it like so to the declaration:
Code:
<asp:datagrid id="dgUsers" runat="server" OnEditCommand="DataGrid_Edit" OnDeleteCommand="DataGrid_Delete">
<Columns>
<asp:EditCommandColumn ButtonType="LinkButton" EditText="Edit" HeaderText="Edit" />
</Columns>
</asp:datagrid>
Anyone see what I'm doing wrong here? What must I do to wire the event up?
Thanks!
paul