Results 1 to 2 of 2
Thread: Gridview/ODS Timing Problems
Mar 12, 2009, 12:14 #1
Gridview/ODS Timing Problems
On one of my pages I have a GridView along with a user control. The user control contains a TreeView and exposes a property indicating which node was clicked. Finally, the Gridview is bound to an ODS whose parameter is set based on the property exposed by the user control. In plain english, I get some number of records based on the tree node that is clicked.
When binding the Gridview to my ODS I immediately noticed a problem: the data displayed in my Gridview was incorrect. The problem arises from the fact that the 'SelectedNodeChanged' event of the TreeView in my user control was firing after the 'Selecting' event of the ODS. So, when I clicked on a TreeView node, a postback was issued but the property exposed by the user control hadn't been property initialized when the ODS 'Selecting' event fired.
To remedy this problem I created a custom event that I fire from the user control when a node is clicked and I catch this event in the page. From there I just bind the Gridview to its data programmatically. That part of the coding has been somewhat simple, but not that I'm getting into paging and sorting things are getting a bit dicier.
In my particular case, is the ODS simply out of the picture at this point? Am I forced to handle all binding/sorting/paging programmatically?
Mar 13, 2009, 04:09 #2
- Join Date
- Jul 2001
- 0 Post(s)
- 0 Thread(s)