Show only Date in DataGridView Column

前端 未结 2 766
春和景丽
春和景丽 2021-01-27 05:46

I have a field as DateTime, I want to display only date( without time ) in my datagridview c#. I get the datetime. example: 22.03.2016 00:00:00 Any help would be appreciated. I

2条回答
  •  醉梦人生
    2021-01-27 05:56

    There is an easier way. Next time, if you add data to DataGridView via clicking the little triangle at the right-top corner of DataGridView;

    Edit your XXXDataSet.Designer according to:

    this.columnYYY = new global::System.Data.DataColumn("YYY", typeof(**string**), null, global::System.Data.MappingType.Element);

    Change String to DateTime. Problem solved enjoy. :)

提交回复
热议问题