I have a gridview that loads a list of data from my database based off a value in the querystring. The data is bound to the gridview in the page_load event in c# code behind and through paging is set to display 1 item at a time. In my ASP.NET page, I have a user control that loads a set of comments based off a unique ID for the item loading in my gridview. I also have a custom pager with prev and next links to page through my gridview.
When I load the page from a link, my gridview fields and comments usercontrol load fine. My problem appears when I page through the records. Because of the load_page order, my gridview is bound and it triggers my onDataBound, onRowDataBound functions and sets my value to load my comments user control (again separate from gridview in page) for the previous value (when paging). The onIndexChanging event is than fired which updates the gridview to the new value with a new databind, but fails to reload my usercontrol.
My problem is that I can't reload/refresh my user control and as result it always shows the comments for the previous record.
Is there a way to manually reload the usercontrol? Or is there a better way to organize my load events to ensure that the usercontrol is always bound before the page is drawn-more specifically bound after the onIndexChanging function is triggered.
Any help would be appreciated.