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 Get DropDown value From GridView by clicking EDIT button and drop Down Value Shold be selected

How to Get DropDown value From GridView by clicking EDIT button and drop Down Value Shold be selected

Scheduled Pinned Locked Moved ASP.NET
tutorial
1 Posts 1 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
    mrgaddam
    wrote on last edited by
    #1

    Hi, This is from CHandrakanth. I have one gridview in that EDIT button is there. When i click on Edit Button the columnValue(ApplicationName - value) should be displayed in the DropdownList and that should be selected. the code and all i giving here protected void gdvRoleDetails_RowCommand(object sender, GridViewCommandEventArgs e) { ddlApplications1.SelectedIndex = 0; GridViewRow row = (GridViewRow)gdvRoleDetails.Rows[Convert.ToInt32(e.CommandArgument)]; if (e.CommandName == "Edit") { ListItem item = new ListItem(); item.Text = row.Cells[2].Text; ddlApplications1.Items.Clear(); hdnRoleId.Value = row.Cells[0].Text; txtRoleName.Text = row.Cells[1].Text; hdnAppl.Value = row.Cells[3].Text; ddlApplications1.SelectedIndex = ddlApplications1.Items.IndexOf(ddlApplications1.Items.FindByText(row.Cells[2].Text )); } } can any one suggest me what to follow for that

    Chandrakanth

    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