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. Database & SysAdmin
  3. Database
  4. Select value of DropDawnList Inside GridView

Select value of DropDawnList Inside GridView

Scheduled Pinned Locked Moved Database
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.
  • M Offline
    M Offline
    msomar
    wrote on last edited by
    #1

    FormView1.FindControl("TextBox2") as TextBox;

    I need like it to select the value for DrowpDownList inside GridView

    P M 2 Replies Last reply
    0
    • M msomar

      FormView1.FindControl("TextBox2") as TextBox;

      I need like it to select the value for DrowpDownList inside GridView

      P Offline
      P Offline
      Paramhans Dubey
      wrote on last edited by
      #2

      (GridView1.Rows[Index].findControl("DropDownList1") as DropDownList).SelecteedValue

      M 1 Reply Last reply
      0
      • P Paramhans Dubey

        (GridView1.Rows[Index].findControl("DropDownList1") as DropDownList).SelecteedValue

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

        I tried your code . but there is some error : Compiler Error Message: CS0122: 'System.Data.Index' is inaccessible due to its protection level

        P 2 Replies Last reply
        0
        • M msomar

          I tried your code . but there is some error : Compiler Error Message: CS0122: 'System.Data.Index' is inaccessible due to its protection level

          P Offline
          P Offline
          Paramhans Dubey
          wrote on last edited by
          #4

          Try this code in selectedIndexChanged event of dropdownlist

          DropDownList ddl = (sender as DropDownList);
          string val = ddl.SelectedValue;

          1 Reply Last reply
          0
          • M msomar

            I tried your code . but there is some error : Compiler Error Message: CS0122: 'System.Data.Index' is inaccessible due to its protection level

            P Offline
            P Offline
            Paramhans Dubey
            wrote on last edited by
            #5

            try this

            foreach(GridViewRow gr in Gridview1.Rows)
            {
            string str = ((DropDownList)gr.FindControl("DropDowmList1")).SelectedValue;
            }

            1 Reply Last reply
            0
            • M msomar

              FormView1.FindControl("TextBox2") as TextBox;

              I need like it to select the value for DrowpDownList inside GridView

              M Offline
              M Offline
              msomar
              wrote on last edited by
              #6

              please see the following url http://tareemnet.com/drop.JPG User Name : adnet Pass : 123 When Editting, the user can change the value using the dropdownlist, and then updating with that new value selected. I'm beginner, please provide me a full code in c# for that issue.

              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