C#在运行时设置日期选择器时遇到问题

时间:2020-01-13 15:59:07

标签: c# winforms

我不确定要走的路。我正在创建一个表,该表列出了文件夹位置中的所有图像。我需要为每个图像在此表中添加列,其中之一应该是日期选择器,但是格式化的方式很少。

DataTable table = new DataTable();
table.Columns.Add("File Name");
table.Columns.Add("Receipt Date");
table.Columns[1].DataType = System.Type.GetType("System.DateTime");
table.Columns.Add("Category");
table.Columns.Add("Amount");
table.Columns.Add("Comments");
table.Columns.Add("Attach");

for (int i = 0; i < files.Length; i++)
{
    FileInfo file = new FileInfo(files[i]);

    table.Rows.Add(file.Name);
};

dataGridView1.DataSource = table;

0 个答案:

没有答案