Is the following correct:
You have a GridView where the RowCreated event is added to the master page code-behind page!? You know want to replace the GridView when it's not needed for other content pages, and know you want to know where to have the RowCreated method, correct?
If so, I should in your case create my own custom GridView control by inheriting the GridView class and override the RowCreated method and add the code that should add the images to the header. If you do that, you have implemented the logic into a control, and don't need to have the code located in the master page file.
/Fredrik Norm?n NSQUARED2
Microsoft MVP, MCSD, MCAD, MCT
CornerstoneMy Blog, ASP.Net 2.0 etc