C# 在DataGridView'中显示文本;默认的新行是什么?
如果将C# 在DataGridView'中显示文本;默认的新行是什么?,c#,winforms,datagridview,C#,Winforms,Datagridview,如果将DataGridView设置为允许编辑新行,是否可以在其默认新行中显示字符串,例如“单击此处以输入新项…”在设计模式下打开列属性编辑器(在属性窗口中)并为列集的DefaultCellStyle显示空值=“单击此处输入新项目…”; 生成的代码(在InitializeComponent()方法中)如下所示 System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.
DataGridView
设置为允许编辑新行,是否可以在其默认新行中显示字符串,例如“单击此处以输入新项…”在设计模式下打开列
属性编辑器(在属性窗口中)并为列集的DefaultCellStyle
显示空值=“单击此处输入新项目…”;
生成的代码(在InitializeComponent()
方法中)如下所示
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1
= new System.Windows.Forms.DataGridViewCellStyle();
dataGridViewCellStyle1.NullValue = "Click here to enter new item...";
this.Column1.DefaultCellStyle = dataGridViewCellStyle1;