• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 299
  • Last Modified:

What has the signature as DataGridItemEventArgs?

I'm attempting to have a dataview call a DataGridItemEventArgs command. I used

OnDataBound="grdPromoDetail_ItemDataBound" in the html, but I'm receiving the complaint:

Method 'Protected Sub grdPromoDetail_ItemDataBound(sender As Object, e As System.Web.UI.WebControls.DataGridItemEventArgs)' does not have the same signature as delegate 'Delegate Sub EventHandler(sender As Object, e As System.EventArgs)

What does, then?
0
barnesco
Asked:
barnesco
  • 2
  • 2
1 Solution
 
digitalZoCommented:
It missing the handler:
  Private Sub grdPromoDetail_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles grdPromoDetail.ItemDataBound
 
    End Sub

Open in new window

0
 
barnescoAuthor Commented:
I'm receiving an error message "'ItemDataBound' cannot be found" on the Handles grdPromoDetail.ItemDataBound
0
 
digitalZoCommented:
Are you using a GridView? Because ItemDataBound is used for DataGrid and not GridView. For GridView, it is RowDataBound. So your code should be [that is, if you're using GridView and not DataGrid]:


Protected Sub grdPromoDetail_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles grdPromoDetail.RowDataBound
 
End Sub

Open in new window

0
 
barnescoAuthor Commented:
It is a gridview, and your last post fixed the problem. I thought it might have been the RowDataBound, but I couldn't get the signature to match--I had the incorrect "e As System.Web.UI.WebControls.GridViewRowEventArgs" part--kept thinking it was suppose to be DataGridItemEventArgs.

Thank you for your persistence and patience.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now