Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想隐藏特定行的某些列..我试过这个,但它似乎不起作用。有什么想法吗?这是我的代码:
dataGridView1.Rows[e.RowIndex].Cells[0].visible=false;
没有简单的方法可以仅隐藏特定行的某些单元格。如果您不想隐藏整列,那么您必须创建看起来像DataGridView背景的自定义单元格,这很容易,但您需要处理该单元格的点击事件、按键事件等,这非常麻烦。
DataGridView
我的建议是改变你的方法。