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. Table problem in vb.net1.1

Table problem in vb.net1.1

Scheduled Pinned Locked Moved ASP.NET
helpcsharp
8 Posts 5 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.
  • A Offline
    A Offline
    amaneet
    wrote on last edited by
    #1

    I am placing the table into the edititemtemplate of DataGrid Control.I want to find the table in the codebehind file programically. i am placing in edititemtemplate as <edititemtemplate> <table id = "dynamic"> </table> </edititemtemplate> I am finding the table in the ItemDataBound function in this manner dim c as control=e.item.findcontrol("dynamic") But c comes out to be nothing Please help

    M J K 3 Replies Last reply
    0
    • A amaneet

      I am placing the table into the edititemtemplate of DataGrid Control.I want to find the table in the codebehind file programically. i am placing in edititemtemplate as <edititemtemplate> <table id = "dynamic"> </table> </edititemtemplate> I am finding the table in the ItemDataBound function in this manner dim c as control=e.item.findcontrol("dynamic") But c comes out to be nothing Please help

      M Offline
      M Offline
      mnaveed
      wrote on last edited by
      #2

      i think you need to make your table attribute runat=server in order to get it in code file Nav.

      A 1 Reply Last reply
      0
      • A amaneet

        I am placing the table into the edititemtemplate of DataGrid Control.I want to find the table in the codebehind file programically. i am placing in edititemtemplate as <edititemtemplate> <table id = "dynamic"> </table> </edititemtemplate> I am finding the table in the ItemDataBound function in this manner dim c as control=e.item.findcontrol("dynamic") But c comes out to be nothing Please help

        J Offline
        J Offline
        Jesse Squire
        wrote on last edited by
        #3

        I believe that you'll need to add the attribute runat = "server" to your table: ... <edititemtemplate> <table id = "dynamic" runat = "server"> ... That should allow you to use FindControl to retrieve it. Hope that helps. :) --Jesse

        A 1 Reply Last reply
        0
        • M mnaveed

          i think you need to make your table attribute runat=server in order to get it in code file Nav.

          A Offline
          A Offline
          amaneet
          wrote on last edited by
          #4

          It is still not working.:)Thanks

          C 1 Reply Last reply
          0
          • J Jesse Squire

            I believe that you'll need to add the attribute runat = "server" to your table: ... <edititemtemplate> <table id = "dynamic" runat = "server"> ... That should allow you to use FindControl to retrieve it. Hope that helps. :) --Jesse

            A Offline
            A Offline
            amaneet
            wrote on last edited by
            #5

            It is still not working :)Thanks

            1 Reply Last reply
            0
            • A amaneet

              I am placing the table into the edititemtemplate of DataGrid Control.I want to find the table in the codebehind file programically. i am placing in edititemtemplate as <edititemtemplate> <table id = "dynamic"> </table> </edititemtemplate> I am finding the table in the ItemDataBound function in this manner dim c as control=e.item.findcontrol("dynamic") But c comes out to be nothing Please help

              K Offline
              K Offline
              Khawar Abbas1
              wrote on last edited by
              #6

              Man try this thing dim c as control=e.item(index).findcontrol("dynamic") You should mention the index of the datagrid row. Do good and have good.

              A 1 Reply Last reply
              0
              • A amaneet

                It is still not working.:)Thanks

                C Offline
                C Offline
                cloudking11966
                wrote on last edited by
                #7

                It will work Boss. Make sure your aspx page is in the format

                ok

                --------------------------------------- and you have properly binding data to Datagrid DataTable dt=new DataTable(); dt.Columns.Add(new DataColumn("One")); DataRow drow=dt.NewRow(); drow[0]="okman"; dt.Rows.Add(drow); DataGrid1.DataSource =dt; DataGrid1.DataBind(); -------------In item databound event write below if(e.Item.FindControl("tbl")!=null) { Response.Write("Found"); } It will write "Found"

                1 Reply Last reply
                0
                • K Khawar Abbas1

                  Man try this thing dim c as control=e.item(index).findcontrol("dynamic") You should mention the index of the datagrid row. Do good and have good.

                  A Offline
                  A Offline
                  amaneet
                  wrote on last edited by
                  #8

                  it is producing error sorry:)

                  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