Grid Control ItemData event not firing

H

HandA

I have a grid control on a page that I copied from another page and
modified.
For some reason it seem my ItemData event never fires.

I even put a break point in it and it doesn't get there.
I tried response.write and response.end in that event and it doesn't output
anything.

Any ideas?

Thanks
 
K

Ken Cox [Microsoft MVP]

Could you post the code that isn't working? The event handler should look
like this:

Private Sub DataGrid1_ItemDataBound _
(ByVal sender As Object, _
ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) _
Handles DataGrid1.ItemDataBound
' Your code goes here
End Sub

VS.NET used to play tricks by removing the Handles clause.
 
H

HandA

Well, I checked for that and it seemed to be right.
I am not at the computer that has the code on it at present. I will respond
as soon as I back at that location with the code.

It did have a handles event that appeared right at first glance.

Will get back to you.

Thanks

Shane
 
S

SStory

Hi Ken,

I wrote you before from a different machine, thus the HandA

Anyhow,

Here is the code..

'at the top
Protected WithEvents grdRepInvoices As System.Web.UI.WebControls.DataGrid

'then the event code
Private Sub grdRepInvoices_ItemCommand(ByVal source As Object, ByVal e As
system.Web.UI.WebControls.DataGridCommandEventArgs) Handles
grdRepInvoices.ItemCommand
Response.Write("got here")
Response.End()
end sub

Like I said, I use the same code in several pages but for some reason this
appears to never fire.
I am dumbfounded and looking for some obvious dumb mistake but can't see it
yet.

Thanks,

Shane
 

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,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top