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.
我想在数据网格视图特定列上定义默认文本值。如果该列只能接受DateTime值。在表单加载时,该DateTime格式应该对用户可见。
DateTime
尝试
if (dataGridView1.Columns[i].ValueType == typeof(DateTime)) { dataGridView1.Columns[ColumnIndex].DefaultCellStyle.Format = "dd/MM/yyyy"; }