如何使用自定义格式将数据网格视图数据分配给日期时间选择器? [英] How to assign data grid view data to date time picker with custom format?
问题描述
如何使用自定义格式将数据网格视图数据分配给日期时间选择器?格式为ddd-MM-yy,C#winforms
这是我的代码
string recievingDate = dgInvoice.SelectedRows [0] .Cells [4] .Value.ToString();
txtRecievedDate.Text = recievingDate;
它适用于默认值和自定义格式
我尝试了什么:
i尝试了不同的组合自定义格式,但它只适用于全长fomat而不适用于自定义格式
how to assign data grid view data to date time picker with custom format? the format is "ddd-MM-yy", C# winforms
this is my code
string recievingDate = dgInvoice.SelectedRows[0].Cells[4].Value.ToString();
txtRecievedDate.Text = recievingDate;
it works for default value and for the custom format
What I have tried:
i tried different combination of custom formats but it only works for full length fomat and not for the custom format
推荐答案
这是我的代码
string recievingDate = dgInvoice。 SelectedRows [0] .Cells [4] .Value.ToString();
txtRecievedDate.Text = recievingDate;
this is my code
string recievingDate = dgInvoice.SelectedRows[0].Cells[4].Value.ToString();
txtRecievedDate.Text = recievingDate;
这篇关于如何使用自定义格式将数据网格视图数据分配给日期时间选择器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!