Notifications
Clear all
[Closed] Hide Column in DataGridView
Sep 10, 2011 1:32 pm
I want made script for object properties with DataGridView
The problem that I want to hide some columns depend on current render. So when the user choose not Vray render the columns that correspond for Vray properties hides.
1.Add callback
callbacks.addScript #postRendererChange "HideVrayColumns()" id:#RendChange
- Function for hidden
fn HideVrayColumns =
( rencur = renderers.current as String
if (matchPattern rencur pattern:"*V_ray*" ) == true then
( -- HERE THE PROBLEM PART
rltMain.dnctrlDataGridView.Columns["VrayMat"].Visible = true)
else (rltMain.dnctrlDataGridView.Columns["VrayMat"].Visible = false)
)
The columns property seems read only.Is there are a way to do this ?
.Columns : <System.Windows.Forms.DataGridViewColumnCollection>, read-only
7 Replies
1 Reply
What this means is that you can not directly set the property DataGridViewColumnCollection of DataGridView.
It does not mean that all sub-properties (for example, properties of individual columns of the columnCollection) are read only.
2 Replies
Sep 10, 2011 1:32 pm
use
rltMain.dnctrlDataGridView.Columns.[B]item[/B]["VrayMat"].visible
That is the syntax to access members of dotnet collections.
Sep 10, 2011 1:32 pm
Sorry for so many posts in a row
I think a simpler check for this is
classof renderers.current != vray