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. Dropdownlist in datagrid

Dropdownlist in datagrid

Scheduled Pinned Locked Moved ASP.NET
databasetutorial
5 Posts 3 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.
  • S Offline
    S Offline
    sarah_chandran
    wrote on last edited by
    #1

    hi all, i want to know how to select as item from the dropdownlist in the datagrid and have the textbox in the datagrid filled with the corresponding value from database. for eg if i select product name from dropdownlist then the textbox in datagrid must be populated with the price from the database for the corresponding product name. p.s. i know how to add items from db in dropdownlist which is in datagrid i just want to know the code for how to select the item from dropdownlist in the datagrid and have the textbox in the datagrid filled with the corresponding value from database.

    A M 2 Replies Last reply
    0
    • S sarah_chandran

      hi all, i want to know how to select as item from the dropdownlist in the datagrid and have the textbox in the datagrid filled with the corresponding value from database. for eg if i select product name from dropdownlist then the textbox in datagrid must be populated with the price from the database for the corresponding product name. p.s. i know how to add items from db in dropdownlist which is in datagrid i just want to know the code for how to select the item from dropdownlist in the datagrid and have the textbox in the datagrid filled with the corresponding value from database.

      A Offline
      A Offline
      Al Ortega
      wrote on last edited by
      #2

      There are some good article w/ code examples on dotnetjohn.com that discuss dropdown, check boxes and such in datagrids just like you are looking for. Al

      S 1 Reply Last reply
      0
      • S sarah_chandran

        hi all, i want to know how to select as item from the dropdownlist in the datagrid and have the textbox in the datagrid filled with the corresponding value from database. for eg if i select product name from dropdownlist then the textbox in datagrid must be populated with the price from the database for the corresponding product name. p.s. i know how to add items from db in dropdownlist which is in datagrid i just want to know the code for how to select the item from dropdownlist in the datagrid and have the textbox in the datagrid filled with the corresponding value from database.

        M Offline
        M Offline
        minhpc_bk
        wrote on last edited by
        #3

        Hi there, You can create an event handler for the SelectedIndexChanged event of the DropDownlist, and also remember to the AutoPostBack property to true. When the user selects a new value from the dropdownlist, the page posts back to the server, and you can provide a snippet of code in the event handler of the SelectedIndexChanged to pull out the value from DB and assign it to the textbox in that row. You can find the site datagridgirl[^] tons of datagrid examples.

        S 1 Reply Last reply
        0
        • A Al Ortega

          There are some good article w/ code examples on dotnetjohn.com that discuss dropdown, check boxes and such in datagrids just like you are looking for. Al

          S Offline
          S Offline
          sarah_chandran
          wrote on last edited by
          #4

          thanks Al Ortega for taking the time to read my doubt and reply. i'll check out the site

          1 Reply Last reply
          0
          • M minhpc_bk

            Hi there, You can create an event handler for the SelectedIndexChanged event of the DropDownlist, and also remember to the AutoPostBack property to true. When the user selects a new value from the dropdownlist, the page posts back to the server, and you can provide a snippet of code in the event handler of the SelectedIndexChanged to pull out the value from DB and assign it to the textbox in that row. You can find the site datagridgirl[^] tons of datagrid examples.

            S Offline
            S Offline
            sarah_chandran
            wrote on last edited by
            #5

            thanks minhpc_bk for taking the time to read my doubt and reply. thanks for the info.i'll check out the site

            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