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. Problem with gridview

Problem with gridview

Scheduled Pinned Locked Moved ASP.NET
questionhelp
7 Posts 6 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.
  • S Offline
    S Offline
    sarang_k
    wrote on last edited by
    #1

    Hi all , I am using a gridview in which the values of one column are my primary keys of the table.What i want is how can i hide that column and when deleting the row in gridview how can i access that hided column value ???? Thanks in advance............

    A A S R 4 Replies Last reply
    0
    • S sarang_k

      Hi all , I am using a gridview in which the values of one column are my primary keys of the table.What i want is how can i hide that column and when deleting the row in gridview how can i access that hided column value ???? Thanks in advance............

      A Offline
      A Offline
      anujbanka1784
      wrote on last edited by
      #2

      go to edit templates select that row and se properties visibility false

      1 Reply Last reply
      0
      • S sarang_k

        Hi all , I am using a gridview in which the values of one column are my primary keys of the table.What i want is how can i hide that column and when deleting the row in gridview how can i access that hided column value ???? Thanks in advance............

        A Offline
        A Offline
        Anurag Gandhi
        wrote on last edited by
        #3

        One Solution is: put your Primary Key in a hidden field in Template Field and get it by using find control for that row. Data key names property of GirdView will also help you to achieve that.

        Anurag Gandhi. http://www.softgandhi.co.nr Life is a computer program and every one is the programmer of his own life.

        A 1 Reply Last reply
        0
        • A Anurag Gandhi

          One Solution is: put your Primary Key in a hidden field in Template Field and get it by using find control for that row. Data key names property of GirdView will also help you to achieve that.

          Anurag Gandhi. http://www.softgandhi.co.nr Life is a computer program and every one is the programmer of his own life.

          A Offline
          A Offline
          Abhijit Jana
          wrote on last edited by
          #4

          Anurag Gandhi wrote:

          put your Primary Key in a hidden field in Template Field and get it by using find control for that row.

          Will it be available if we use GridView.FindControl("PrimaryHdnFiled")? :)

          cheers, Abhijit CodeProject MVP My Recent Article : Exploring Session in ASP.Net

          A 1 Reply Last reply
          0
          • A Abhijit Jana

            Anurag Gandhi wrote:

            put your Primary Key in a hidden field in Template Field and get it by using find control for that row.

            Will it be available if we use GridView.FindControl("PrimaryHdnFiled")? :)

            cheers, Abhijit CodeProject MVP My Recent Article : Exploring Session in ASP.Net

            A Offline
            A Offline
            Anurag Gandhi
            wrote on last edited by
            #5

            put your Primary Key in a hidden field in Template Field and get it by using find control for that row. No, The hidden variable will be a child control of each row. GridViewId.Rows[index].FindControl("hidden_field")

            Anurag Gandhi. http://www.softgandhi.co.nr Life is a computer program and every one is the programmer of his own life.

            1 Reply Last reply
            0
            • S sarang_k

              Hi all , I am using a gridview in which the values of one column are my primary keys of the table.What i want is how can i hide that column and when deleting the row in gridview how can i access that hided column value ???? Thanks in advance............

              S Offline
              S Offline
              S Dhanasekaran
              wrote on last edited by
              #6

              Map Primarykey values into Gridview Datakeynames Property. ex: DataKeyNames="" int id = (int)gridview1.DataKeys[e.RowIndex].Value;

              1 Reply Last reply
              0
              • S sarang_k

                Hi all , I am using a gridview in which the values of one column are my primary keys of the table.What i want is how can i hide that column and when deleting the row in gridview how can i access that hided column value ???? Thanks in advance............

                R Offline
                R Offline
                RichardGrimmer
                wrote on last edited by
                #7

                Set its width to 0px in the ColumnHeader attributes, and it will not be shown, but will still be accessible (since it's still actually rendered, whereas setting it to visible=false actually prevents it being rendered)

                C# has already designed away most of the tedium of C++.

                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