Gridview and Textbox Inconsistent Functionality

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • geo039
    New Member
    • Nov 2006
    • 47

    #1

    Gridview and Textbox Inconsistent Functionality

    I have two pages (asp.net) an add screen which loads with blank text boxes with a gridview so users can select items from a list. Two of them work together when the user selects a building from one and they go to select a room they only see the rooms in the bldg they selected. That works fine.

    I have the same functionality on another page in a user control that references the same gridview object. However this page has bound data in the textbox when loaded. If I select a "new" bldg it displays in the textbox fine, however when i go to room and click nothing happens the gridview doesn't drop down at all. But...if I then go back to bldg and select a another one then the second gridview works and populates. I have to click twice to get it to work.

    What am I missing? Why would one page work and not the other? Why would it take two clicks to finally work correctly?

    Any tips? I've been in and out trying to solve this bug for a week.
  • nateraaaa
    Recognized Expert Contributor
    • May 2007
    • 664

    #2
    Originally posted by geo039
    I have two pages (asp.net) an add screen which loads with blank text boxes with a gridview so users can select items from a list. Two of them work together when the user selects a building from one and they go to select a room they only see the rooms in the bldg they selected. That works fine.

    I have the same functionality on another page in a user control that references the same gridview object. However this page has bound data in the textbox when loaded. If I select a "new" bldg it displays in the textbox fine, however when i go to room and click nothing happens the gridview doesn't drop down at all. But...if I then go back to bldg and select a another one then the second gridview works and populates. I have to click twice to get it to work.

    What am I missing? Why would one page work and not the other? Why would it take two clicks to finally work correctly?

    Any tips? I've been in and out trying to solve this bug for a week.
    In your page_load event do you have any code inside of a
    If(!Page.IsPost Back) statement?

    Nathan

    Comment

    • geo039
      New Member
      • Nov 2006
      • 47

      #3
      In the add screen (the one that works) I have default settings
      Code:
      If Not Page.IsPostBack Then
                  WQ_Inventory.Util.setDefault("owner", txtOwner)
                  WQ_Inventory.Util.setDefault("status", txtStatus)
                  WQ_Inventory.Util.setDefault("handheld_mfg", txtMfg)
                  WQ_Inventory.Util.setDefault("handheld_model", txtModel)
                  txtStatusDate.Text = Today
                  If Not Session("security_access").ToString.Contains("readwrite") Then
                      Response.Redirect("~/NoAccess.aspx")
                  End If
              End If
      In the one not working I just have this
      Code:
      Page.MaintainScrollPositionOnPostBack = True
      I can't say the functionality isn't completely working, just weird. It's working it's just not working as it should. It's like it takes two clicks between the two fields for it to set. I just don't know what I could do to get it to set and drop down properly.

      Comment

      Working...