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 giving prob

dropdownlist in datagrid giving prob

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

    public void aa(object sender,System.EventArgs e) { DropDownList dl=(DropDownList)sender; ss=dl.SelectedValue.ToString();----->this is working fine TextBox tb=(TextBox)DataGrid1.FindControl("TextBox1"); tb.Text=ss;------->this is giving error } Object reference not set to an instance of an object.

    Pradeep Reddy

    A 1 Reply Last reply
    0
    • P pradeep kumarappagari

      public void aa(object sender,System.EventArgs e) { DropDownList dl=(DropDownList)sender; ss=dl.SelectedValue.ToString();----->this is working fine TextBox tb=(TextBox)DataGrid1.FindControl("TextBox1"); tb.Text=ss;------->this is giving error } Object reference not set to an instance of an object.

      Pradeep Reddy

      A Offline
      A Offline
      Amit Kumar Chikara
      wrote on last edited by
      #2

      This error is coming because its unable to find control "TextBox1". Recheck it again and give the proper ID of the textbox to find it.

      Regards, Amit Kumar HDISM, PGDCA, MCP, MCAD, MCSD amit_chikara2002@hotmail.com

      P 1 Reply Last reply
      0
      • A Amit Kumar Chikara

        This error is coming because its unable to find control "TextBox1". Recheck it again and give the proper ID of the textbox to find it.

        Regards, Amit Kumar HDISM, PGDCA, MCP, MCAD, MCSD amit_chikara2002@hotmail.com

        P Offline
        P Offline
        pradeep kumarappagari
        wrote on last edited by
        #3

        TextBox tb1,tb2; DropDownList dl1,dl2; dl1=(DropDownList)sender; string ss=dl1.SelectedValue.ToString(); tb1=(TextBox)DataGrid1.Items[0](i was missing this).FindControl("TextBox3"); tb1.Text=ss; thank u i got the solution

        Pradeep Reddy

        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