Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to retain the original value of dropdow?

How to retain the original value of dropdow?

Scheduled Pinned Locked Moved ASP.NET
tutorialquestionannouncement
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    amittinku
    wrote on last edited by
    #1

    I have to update a table based on some values in different dropdowns. One of these values is part of composite primary key also. In row_updating event, I have written the code to update the tabel. Update table xyz set order=order_dropdown.selectedvalue, some more values... where emp_id=3,order=order_dropdown.selectedvalue. Now in "where" and "set" clauses, order_dropdown.selectedvalue has used. "where" should pick up the old value ideally but it will pick up latest value. Due to this, updation does not take place. So how to capture the original value in row_editing event and pass that original value in row_updating event?

    C 1 Reply Last reply
    0
    • A amittinku

      I have to update a table based on some values in different dropdowns. One of these values is part of composite primary key also. In row_updating event, I have written the code to update the tabel. Update table xyz set order=order_dropdown.selectedvalue, some more values... where emp_id=3,order=order_dropdown.selectedvalue. Now in "where" and "set" clauses, order_dropdown.selectedvalue has used. "where" should pick up the old value ideally but it will pick up latest value. Due to this, updation does not take place. So how to capture the original value in row_editing event and pass that original value in row_updating event?

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      You want to get a value other than the value that has been selected ? How do you hope to do that ? You're going to have to store it somewhere. If you mean it's reseting and is NOT the selected value, it's because you're binding the datasource on postback in your page load.

      Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

      A 1 Reply Last reply
      0
      • C Christian Graus

        You want to get a value other than the value that has been selected ? How do you hope to do that ? You're going to have to store it somewhere. If you mean it's reseting and is NOT the selected value, it's because you're binding the datasource on postback in your page load.

        Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

        A Offline
        A Offline
        amittinku
        wrote on last edited by
        #3

        Just providing more details about my requirement: I have a gridview that has a dropdown column. All works fine until I go to edit mode. Here if change any value in dropdown, I can select that. But what about the original value? how to fetch that?

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups