EditCommandColumn event handling

T

tantilis

I am creating a datagrid programmatically and am trying to add an
EditCommandColumn to the datagrid but I'm having a hard time getting
events for this column to fire.

Here's the code:

Dim dg as New DataGrid()
dg.AutoGenerateColumns = false
AddHandler dg.EditCommand, AddressOf grid_edit
AddHandler dg.UpdateCommand, AddressOf grid_update
AddHandler dg.CancelCommand, AddressOf grid_cancel

Dim editCol as new EditCommandColumn()
editCol.EditText = "Edit"
editCol.UpdateText = "Update"
editCol.CancelText = "Cancel"
dg.Columns.add(editCol)


page.FindControl("pnlMainContent").controls.Add(dg)



I'm just trying to get a trace warn out of the edit handler and just
not getting anything indicating this sub ever executed:

Public Sub grid_edit(sender As Object, e As
DataGridCommandEventArgs)
trace.warn("say something you bastard")
End Sub


Any advice would be greatly appreciated,

Thanks in advance.
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top