我正在使用 wxpython 和 wx.Grid...
我有一个包含许多列的通用网格 - 使用 SetColumn(self, column)
创建,我希望能够根据用户安全权限显示和隐藏特定列。
我读到 self.SetColMinimalAcceptableWidth(0)
可能有用?如何在特定列上使用它?当我需要显示该列时,如何将其恢复到原始大小?
最佳答案
网格手册有以下条目:
HideCol(自身, col)
Hides the specified column.
To show the column later you need to call SetColSize with non-0 width or ShowCol to restore the previous column width.
If the column is already hidden, this method doesn’t do anything.
Parameters: col (int) – The column index.
对于 self.Mygrid 来说:
self.Mygrid.HideCol(0)
将隐藏第一列。
关于python - 是否可以隐藏网格中的特定列?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32046360/