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