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. DataGrid column hiding

DataGrid column hiding

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netdatabasehelp
3 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.
  • I Offline
    I Offline
    Imtiaz Murtaza
    wrote on last edited by
    #1

    Hello All, I am using GridView Control of ASP.Net 2.0. The problem is I want to hide the column containing record Primary key and still want to access it on RowBound Property. If I hide Primary Key column then its values are no more accessible. Also please tell me if there is any ID attribute associated with BoundColumn of GridView as I did not find it any where. I do want to access columns not by index but by ID name. Thanks in advance.

    Imtiaz

    D P 2 Replies Last reply
    0
    • I Imtiaz Murtaza

      Hello All, I am using GridView Control of ASP.Net 2.0. The problem is I want to hide the column containing record Primary key and still want to access it on RowBound Property. If I hide Primary Key column then its values are no more accessible. Also please tell me if there is any ID attribute associated with BoundColumn of GridView as I did not find it any where. I do want to access columns not by index but by ID name. Thanks in advance.

      Imtiaz

      D Offline
      D Offline
      Dipan Patel From Gandhinagar
      wrote on last edited by
      #2

      HI.. u can write the property like visible=False in html window for this. then it will be hide and u can also access the column.. just try this...

      Dipan Patel.

      1 Reply Last reply
      0
      • I Imtiaz Murtaza

        Hello All, I am using GridView Control of ASP.Net 2.0. The problem is I want to hide the column containing record Primary key and still want to access it on RowBound Property. If I hide Primary Key column then its values are no more accessible. Also please tell me if there is any ID attribute associated with BoundColumn of GridView as I did not find it any where. I do want to access columns not by index but by ID name. Thanks in advance.

        Imtiaz

        P Offline
        P Offline
        ptvce
        wrote on last edited by
        #3

        when u write a select command for ur grid for binding u can use datakaysname for ur primary key write DataKeyNames="id" in html code where ur gridview created and then u can write: datagrid.datakey["tbl_id"] but u should write id in ur select for example : select id,name,lname from aaa

        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