如何在datagridview中格式化空日期时间?我以编程方式创建 datagridview 列,在表单加载
DataGridViewCellStyle style = new DataGridViewCellStyle();
style.Format = "dd-MM-yyyy";
DataGridViewTextBoxColumn updatedDateColumn = new DataGridViewTextBoxColumn();
updatedDateColumn.DataPropertyName = "UpdatedDate";
updatedDateColumn.HeaderText = "Updated Date";
updatedDateColumn.Name = "UpdatedDate";
updatedDateColumn.DefaultCellStyle = style;
问题是当更新日期值为空时 datagridview 显示 01/01/0001 12:00:00
我试图编辑
style.NullValue = string.Empty;
但它没有工作如何解决这个问题?谢谢