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.
我查看了http://msdn.microsoft.com/en-us/library/7tas5c80.aspx以供参考,就可编辑列而言它是有意义的。
问题是如何在 DataGridView(WinForm 和 C#)中托管“仅查看”自定义控件?
从 DataGridViewCell 派生并覆盖 Paint 方法。
另一种简单的方法是使该列成为网格的“DataKeyNames”列之一。默认情况下,任何被认为是“键”的字段都被用户编辑禁用。但是,如果您在“单击”记录上进行对象分析以进行编辑或其他操作,则返回的键数组将与 DataKeyNames 属性中列出的顺序相同。因此,即使您可能忽略了作为“键”的实际值,它也可以禁用它。
高温高压