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. Visual Basic
  4. datagridview in vb.net 2008

datagridview in vb.net 2008

Scheduled Pinned Locked Moved Visual Basic
helpcsharpcsstutorial
7 Posts 4 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.
  • J Offline
    J Offline
    jigneshDPatel
    wrote on last edited by
    #1

    in my application i want to disable or visible a perticular cell in datagridview in load time the grid by coding i write just like this me.gridview1.row(2).cells(4).visible = false in this coding that give me the error of readonly properity can i visible or disable to perform in perticular cell please help me in this and give me some example please it's urgant....

    M J 2 Replies Last reply
    0
    • J jigneshDPatel

      in my application i want to disable or visible a perticular cell in datagridview in load time the grid by coding i write just like this me.gridview1.row(2).cells(4).visible = false in this coding that give me the error of readonly properity can i visible or disable to perform in perticular cell please help me in this and give me some example please it's urgant....

      M Offline
      M Offline
      Mycroft Holmes
      wrote on last edited by
      #2

      I don't think you can hide a cell, you can hide a row or column and you may have control of enable on the cell.

      Never underestimate the power of human stupidity RAH

      1 Reply Last reply
      0
      • J jigneshDPatel

        in my application i want to disable or visible a perticular cell in datagridview in load time the grid by coding i write just like this me.gridview1.row(2).cells(4).visible = false in this coding that give me the error of readonly properity can i visible or disable to perform in perticular cell please help me in this and give me some example please it's urgant....

        J Offline
        J Offline
        Jay Royall
        wrote on last edited by
        #3

        As the previous poster said, I don't think you can hide a cell but you can disable it with the 'ReadOnly' property. i.e.

        me.gridview1.row(2).cells(4).ReadOnly = true

        J 1 Reply Last reply
        0
        • J Jay Royall

          As the previous poster said, I don't think you can hide a cell but you can disable it with the 'ReadOnly' property. i.e.

          me.gridview1.row(2).cells(4).ReadOnly = true

          J Offline
          J Offline
          jigneshDPatel
          wrote on last edited by
          #4

          Thanks to Replay I know that this thing ? if u have a some idea of cell will be visibel false so please give me some example

          modified on Wednesday, January 7, 2009 7:10 AM

          J 1 Reply Last reply
          0
          • J jigneshDPatel

            Thanks to Replay I know that this thing ? if u have a some idea of cell will be visibel false so please give me some example

            modified on Wednesday, January 7, 2009 7:10 AM

            J Offline
            J Offline
            Jay Royall
            wrote on last edited by
            #5

            You can't make a cell invisible, well at least I pretty sure you can't. Ypu can make an entire column invisible but not a single cell. All you can do is disable it by making it readonly. For what purpose do you want the cell not to be visible? Maybe there is another solution to your problem.

            J 1 Reply Last reply
            0
            • J Jay Royall

              You can't make a cell invisible, well at least I pretty sure you can't. Ypu can make an entire column invisible but not a single cell. All you can do is disable it by making it readonly. For what purpose do you want the cell not to be visible? Maybe there is another solution to your problem.

              J Offline
              J Offline
              jigneshDPatel
              wrote on last edited by
              #6

              that's use in userrigths 1) in my application first i fill all data in the datagridview through dataset 2) than after i want to give the rights like add,update and delete 3) in my application the delete are not in some form so that not display in gridview just that's purpose i want to not show that perticular cell in datagridvie my datagridview look like this colum 1 colum 2 colum 3 colum 4 colum 5 colum 6 colum 7 colum 8 checkbox formname checkbox add checkbox delete checkbox update remark: checkbox manse thats are checkbox cell Add: Add meanse that's just the heading of colum 5 of the checkbox of add rigths example : in my shiftmaster form delete are not in so in that time in grid view the colum 5 and colum 6 are not display if u have a another idea so please give me thanks you

              D 1 Reply Last reply
              0
              • J jigneshDPatel

                that's use in userrigths 1) in my application first i fill all data in the datagridview through dataset 2) than after i want to give the rights like add,update and delete 3) in my application the delete are not in some form so that not display in gridview just that's purpose i want to not show that perticular cell in datagridvie my datagridview look like this colum 1 colum 2 colum 3 colum 4 colum 5 colum 6 colum 7 colum 8 checkbox formname checkbox add checkbox delete checkbox update remark: checkbox manse thats are checkbox cell Add: Add meanse that's just the heading of colum 5 of the checkbox of add rigths example : in my shiftmaster form delete are not in so in that time in grid view the colum 5 and colum 6 are not display if u have a another idea so please give me thanks you

                D Offline
                D Offline
                Dave Kreskowiak
                wrote on last edited by
                #7

                I would highly suggest changing your design. You can NOT hide individual cells in a DataGridView. Changing the colors of the cell so the foreground matches the background also will not work because the user can just select the contents of the cell to invert the color of the background. The only way I can think of doing this would be to override the drawing of the DataGridViewColumn this data is in and paint it only if your conditions are met. But, this is quite a bit work to pull off and way beyond the scope of a forum post. I suggest Google for something like "Ownerdraw DataGridViewColumn" for examples.

                A guide to posting questions on CodeProject[^]
                Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                     2006, 2007, 2008

                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