Search code examples
c#gridviewdetailsvieweventargs

GridView information in DetailsView_ItemCreated


I have a Gridview with a select button. That select button causes a DetailsView to be created. I am using a custom DataBind method for the DetailsView. The custom DataBind method does call detailsview.DataBind() which then fires detailsview_ItemCreated. The EventArgs for detailsview_ItemCreated is empty.

I need to get the ID of the "parent" GridView.

detailsview_ItemCreated fires immediately after detailsview_DataBind() executes in the custom DataBind method so I'm not sure if I could add to EventArgs at some point or if I need to fire the method itself from the DataBind method. Or something else altogether.

Any help is appreciated


Solution

  • Took a different approach and implemented the Page extension method in On postback, how can I check which control cause postback in Page_Init event then checked an IF for which GridView caused the postback