简体   繁体   English

删除未显示ID的DataGridView行

[英]Delete DataGridView row that isn't showing ID

I have a Windows Form Application with a DataGridView. 我有一个带有DataGridView的Windows窗体应用程序。

AutoGenerateColumns is false so I have added the columns manually AutoGenerateColumns为false,因此我手动添加了列

I left out the ID field from the added columns and added a DataGridViewButtonColumn column. 我从添加的列中省略了ID字段,并添加了一个DataGridViewButtonColumn列。

How do I associate the ID to the row without displaying it so that the Delete button deletes the row it is on? 如何在不显示ID的情况下将ID与行关联,以便“删除”按钮删除它所在的行?

As per @forklift comment. 根据@forklift评论。 Making the column not visible worked fine. 使列不可见工作正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM