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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. gridview

gridview

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

    Hi, I am working on gridview control... it shows data from a table having columns Sid, Sname,.... I want to hide the sid column from vewing in gridview but use its value on selecting a particular row. how to achieve this... I used mygridview.columns[0].visible= false; but it gives : System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection Help me..:rose:

    Sangram (A battle with self) Life is simple, we are the ones makes the living difficult

    I A 2 Replies Last reply
    0
    • S sangramkp

      Hi, I am working on gridview control... it shows data from a table having columns Sid, Sname,.... I want to hide the sid column from vewing in gridview but use its value on selecting a particular row. how to achieve this... I used mygridview.columns[0].visible= false; but it gives : System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection Help me..:rose:

      Sangram (A battle with self) Life is simple, we are the ones makes the living difficult

      I Offline
      I Offline
      Imran Khan Pathan
      wrote on last edited by
      #2

      try this code mygridview.Rows[0].Cells[0].Visible=false; Best Regard Pathan

      ---------------------------------------------------

      1 Reply Last reply
      0
      • S sangramkp

        Hi, I am working on gridview control... it shows data from a table having columns Sid, Sname,.... I want to hide the sid column from vewing in gridview but use its value on selecting a particular row. how to achieve this... I used mygridview.columns[0].visible= false; but it gives : System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection Help me..:rose:

        Sangram (A battle with self) Life is simple, we are the ones makes the living difficult

        A Offline
        A Offline
        Abolfazl Sheikhloo
        wrote on last edited by
        #3

        use gridview.DataKeyNames property for fetching data from it. use gridview.DataKeyNames = "sid,... and more"; bind your grid. and for fetching it use string id = gridview.SelectedDataKey["sid"].ToString(); or string id = gridview.DataKeys[0 or 1 or 2 or 3 or ...]["sid"].ToString();

        We Can Do Anything, If We Want It

        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