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. cannot bind the ddl in my editable gridview

cannot bind the ddl in my editable gridview

Scheduled Pinned Locked Moved ASP.NET
3 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.
  • L Offline
    L Offline
    LucBite
    wrote on last edited by
    #1

    I have a dropdownlist within my editable gridview.The datasource of the gridview is a datatable method which accepts as a parameter the text of the lable of one of the columns in the gridview.I'm using the code below to try this task but it is not working. protected void gvServices_DataBinding(object sender, GridViewRowEventArgs e) {//gvServices is a gridview name if (e.Row.RowType == DataControlRowType.DataRow) { DropDownList ddl = (DropDownList)e.Row.Cells[3].FindControl("DDLServType"); Label lbl = (Label)e.Row.Cells[2].FindControl("lblServiceName"); string servicename= lbl.Text; ddl.DataSource = st.getServiceTypes(servicename); ddl.DataBind(); } }

    ML Lingwati

    C A 2 Replies Last reply
    0
    • L LucBite

      I have a dropdownlist within my editable gridview.The datasource of the gridview is a datatable method which accepts as a parameter the text of the lable of one of the columns in the gridview.I'm using the code below to try this task but it is not working. protected void gvServices_DataBinding(object sender, GridViewRowEventArgs e) {//gvServices is a gridview name if (e.Row.RowType == DataControlRowType.DataRow) { DropDownList ddl = (DropDownList)e.Row.Cells[3].FindControl("DDLServType"); Label lbl = (Label)e.Row.Cells[2].FindControl("lblServiceName"); string servicename= lbl.Text; ddl.DataSource = st.getServiceTypes(servicename); ddl.DataBind(); } }

      ML Lingwati

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

      Perhaps if you whip it harder, it will work more ? If you want more meaningful help, you have to tell us 1 - what 'not working' means 2 - if you're sure this code is being called 3 - what happens as you step through the code in the debugger.

      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.

      1 Reply Last reply
      0
      • L LucBite

        I have a dropdownlist within my editable gridview.The datasource of the gridview is a datatable method which accepts as a parameter the text of the lable of one of the columns in the gridview.I'm using the code below to try this task but it is not working. protected void gvServices_DataBinding(object sender, GridViewRowEventArgs e) {//gvServices is a gridview name if (e.Row.RowType == DataControlRowType.DataRow) { DropDownList ddl = (DropDownList)e.Row.Cells[3].FindControl("DDLServType"); Label lbl = (Label)e.Row.Cells[2].FindControl("lblServiceName"); string servicename= lbl.Text; ddl.DataSource = st.getServiceTypes(servicename); ddl.DataBind(); } }

        ML Lingwati

        A Offline
        A Offline
        Abhishek Sur
        wrote on last edited by
        #3

        use onrowdatabound event rather than DataBinding. Also let me know what error it produces ... :cool:

        Abhishek Sur


        My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB

        **Don't forget to click "Good Answer" if you like to.

        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