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. ASP.NET DataGrid DropDownList edit problem

ASP.NET DataGrid DropDownList edit problem

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netdatabasehelp
6 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.
  • O Offline
    O Offline
    Old Gun
    wrote on last edited by
    #1

    I use DropDownList edit DataGrid data, There have 4 columns using DropDownList for edit data. Generally I only want to change one column data. But when I enter editing mode, the all DropDownList’s index change to zero, only I want to change one column! How I set all DropDownList Index default to right value.

    _ 1 Reply Last reply
    0
    • O Old Gun

      I use DropDownList edit DataGrid data, There have 4 columns using DropDownList for edit data. Generally I only want to change one column data. But when I enter editing mode, the all DropDownList’s index change to zero, only I want to change one column! How I set all DropDownList Index default to right value.

      _ Offline
      _ Offline
      _AK_
      wrote on last edited by
      #2

      I am not sure whether i have understood the problem correctly but if you want to set some value of the dropdownlist control as selected then this you can do in OnItemDataBound event of the datagrid.

      Best Regards, Apurva Kaushal

      O 1 Reply Last reply
      0
      • _ _AK_

        I am not sure whether i have understood the problem correctly but if you want to set some value of the dropdownlist control as selected then this you can do in OnItemDataBound event of the datagrid.

        Best Regards, Apurva Kaushal

        O Offline
        O Offline
        Old Gun
        wrote on last edited by
        #3

        Thanks for your help. I just want to set a default dropdownlist selectedindex,not use the default zero. I tried in OnItemDataBound event at edit mode ,but I can't get dropdownlist control.Could you give me more tips? thank you

        _ 1 Reply Last reply
        0
        • O Old Gun

          Thanks for your help. I just want to set a default dropdownlist selectedindex,not use the default zero. I tried in OnItemDataBound event at edit mode ,but I can't get dropdownlist control.Could you give me more tips? thank you

          _ Offline
          _ Offline
          _AK_
          wrote on last edited by
          #4

          In that event first you have to check for the edit mode and then you have to find the control by the ID you have given and once you find the control you can set the selected item in that. Hope this makes things a bit clear.

          Best Regards, Apurva Kaushal

          O 1 Reply Last reply
          0
          • _ _AK_

            In that event first you have to check for the edit mode and then you have to find the control by the ID you have given and once you find the control you can set the selected item in that. Hope this makes things a bit clear.

            Best Regards, Apurva Kaushal

            O Offline
            O Offline
            Old Gun
            wrote on last edited by
            #5

            Ok,Thank you.I will try this way right now.

            _ 1 Reply Last reply
            0
            • O Old Gun

              Ok,Thank you.I will try this way right now.

              _ Offline
              _ Offline
              _AK_
              wrote on last edited by
              #6

              always welcome.. :)

              Best Regards, Apurva Kaushal

              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