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. General Programming
  3. C#
  4. textbox-table

textbox-table

Scheduled Pinned Locked Moved C#
tutorialquestion
5 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
    locaas
    wrote on last edited by
    #1

    hello 1) how do i create a textbox with the position x:20 and y:150 from code. 2) is there a function to read a specific row and a column from a table example: read column 4 from row 3 10x

    L T 2 Replies Last reply
    0
    • L locaas

      hello 1) how do i create a textbox with the position x:20 and y:150 from code. 2) is there a function to read a specific row and a column from a table example: read column 4 from row 3 10x

      L Offline
      L Offline
      leppie
      wrote on last edited by
      #2

      This ASP.NET? If so, head to the appropiate message board.**

      How xacc.ide transforms text to colored words on the screen
      Intel PentuimM (aka Centrino) undervolting

      **

      1 Reply Last reply
      0
      • L locaas

        hello 1) how do i create a textbox with the position x:20 and y:150 from code. 2) is there a function to read a specific row and a column from a table example: read column 4 from row 3 10x

        T Offline
        T Offline
        turbochimp
        wrote on last edited by
        #3

        (1) Are you referring to WinForm or WebForm applications for item 1? If you're using WinForms, then you should be able to do something like the following in the form's codebehind: public AddTextBox(string id) { TextBox box = new TextBox(); box.ID = id; box.Top = 150; box.Left = 20; this.Controls.Add(box); } You can do something very similar to the above WinForm example with WebForms, but positioning will take slightly more attention, as will the timing of your control's addition to the form's control hierarchy. (2) Are you referring to a DataTable? If so, then: object value = dataTable.Rows[int rowIndex][string columnName] from your example: object value = dataTable.Rows[3][4]; ...should do it. If you're talking about HTML tables, then it would depend on how the table was created. If you're doing it in code, then you should be able to walk the page's control hierarchy to get at it. If it's static HTML, javascript can do it, but it's kind of a long-winded answer unless you need it, and the question belongs in a different forum. Good luck.

        The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’

        -- modified at 2:19 Monday 22nd May, 2006

        L 1 Reply Last reply
        0
        • T turbochimp

          (1) Are you referring to WinForm or WebForm applications for item 1? If you're using WinForms, then you should be able to do something like the following in the form's codebehind: public AddTextBox(string id) { TextBox box = new TextBox(); box.ID = id; box.Top = 150; box.Left = 20; this.Controls.Add(box); } You can do something very similar to the above WinForm example with WebForms, but positioning will take slightly more attention, as will the timing of your control's addition to the form's control hierarchy. (2) Are you referring to a DataTable? If so, then: object value = dataTable.Rows[int rowIndex][string columnName] from your example: object value = dataTable.Rows[3][4]; ...should do it. If you're talking about HTML tables, then it would depend on how the table was created. If you're doing it in code, then you should be able to walk the page's control hierarchy to get at it. If it's static HTML, javascript can do it, but it's kind of a long-winded answer unless you need it, and the question belongs in a different forum. Good luck.

          The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’

          -- modified at 2:19 Monday 22nd May, 2006

          L Offline
          L Offline
          locaas
          wrote on last edited by
          #4

          box.Top = 150; box.Left = 20; it dosen't work - 'System.Web.UI.WebControls.TextBox' does not contain a definition for 'Top' i'm using vs.2005 do i need to add something else?

          L 1 Reply Last reply
          0
          • L locaas

            box.Top = 150; box.Left = 20; it dosen't work - 'System.Web.UI.WebControls.TextBox' does not contain a definition for 'Top' i'm using vs.2005 do i need to add something else?

            L Offline
            L Offline
            leppie
            wrote on last edited by
            #5

            You should be asking this question in the ASP.NET forum, thats why you are getting wrong answers.**

            How xacc.ide transforms text to colored words on the screen
            Intel PentuimM (aka Centrino) undervolting

            **

            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