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.
如何隐藏 GridView 中的特定行?
例如
如果我单击 2/4/1/7 它将相应地隐藏 3/5/2/8 如何执行此操作
你可以试试这样的
YourDataGridView.CurrentCell = null; YourDataGridView.Rows[rowIndexToHide].Visible = false;
第一行将 CurrentCell 设置为 null,因为您可以隐藏选定的行。