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. Retrieve Unbound column cell data??

Retrieve Unbound column cell data??

Scheduled Pinned Locked Moved ASP.NET
questionhelp
4 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.
  • I Offline
    I Offline
    innocent73
    wrote on last edited by
    #1

    Hello Experts, I want to retrieve cell values from a gridview data row.There are unbound and bound columns in a row.I can retrieve values for bound columns but cannot get it for unbound columns. My code is like below: protected void Button1_Click(object sender, EventArgs e) { GridViewRow objRow = GridView1.SelectedRow; TextBox2.Text = objRow.Cells[41].Text; //bound column TextBox3.Text = objRow.Cells[42].Text; //!!!!unbound column!!!! } Please help.What is wrong?

    T 1 Reply Last reply
    0
    • I innocent73

      Hello Experts, I want to retrieve cell values from a gridview data row.There are unbound and bound columns in a row.I can retrieve values for bound columns but cannot get it for unbound columns. My code is like below: protected void Button1_Click(object sender, EventArgs e) { GridViewRow objRow = GridView1.SelectedRow; TextBox2.Text = objRow.Cells[41].Text; //bound column TextBox3.Text = objRow.Cells[42].Text; //!!!!unbound column!!!! } Please help.What is wrong?

      T Offline
      T Offline
      ToddHileHoffer
      wrote on last edited by
      #2

      Do you have Visual Studio? Why not view your gridview row in the quick watch window and check the properties of the unbound column until you find your text...

      I didn't get any requirements for the signature

      I 1 Reply Last reply
      0
      • T ToddHileHoffer

        Do you have Visual Studio? Why not view your gridview row in the quick watch window and check the properties of the unbound column until you find your text...

        I didn't get any requirements for the signature

        I Offline
        I Offline
        innocent73
        wrote on last edited by
        #3

        Thank you for your reply.Of course I did it...And the result is ""

        T 1 Reply Last reply
        0
        • I innocent73

          Thank you for your reply.Of course I did it...And the result is ""

          T Offline
          T Offline
          ToddHileHoffer
          wrote on last edited by
          #4

          But there is text on the screen? Perhaps the test is stored in a different property. An easy solution is to create a template column. Add a label. Set the text of the label. Use gridviewrow.findcontrol("labelId") to get the label and its text property.

          I didn't get any requirements for the signature

          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