SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru pinch's Avatar
    Join Date
    Mar 2005
    Posts
    688
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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?

    Thanks

  2. #2
    ALT.NET - because we need it silver trophybronze trophy dhtmlgod's Avatar
    Join Date
    Jul 2001
    Location
    Scotland
    Posts
    4,836
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The ODS ia awesome demoware (see second paragraph), not so much for prodiction code. I would recommend getting rid of it and using something else.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •