如何在数据网格视图中生成其关联日期的日期 [英] how to generate day of its associate date in data grid view

查看:56
本文介绍了如何在数据网格视图中生成其关联日期的日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友,我想这样显示我的数据网格视图

例如

hello friend i want to show my data grid view like this

e.g.

set NO        date                day

1        1/1/2005             Monday
2        7/1/2005             Monday
3        14/1/2005            Monday
4        21/1/2005            Monday
5        28/1/2005            Monday
6        5/2/2005             Monday
7        12/2/2005            Monday
8        19/2/2005            Monday
9        26/2/2005            Monday  



当用户在日期单元格中输入第一个日期时,在按Enter键时,日期列应立即用日期名称填充,而setNO现在应用1填充.光标移动到日期列的下一个单元格,将包含7天的日期设置为日期名称,将dayName设置为关联的日期单元格和2代表setNO ...等等...

请朋友帮我..我该怎么办...请拜托.......

感谢高级

lakhan



as user enter the fist date in date cell , the day column should fill with day name and setNO fill with 1 now as he press enter key the cursor move to the next cell of date column incrise date with 7 day set dayName to assosiat day cell and 2 for setNO...an so on...

please friend help me ..what i have to do...please please please.......

thanks in advanced

lakhan

推荐答案

只需使用DateTime DayOfWeek属性即可获取值.
请参阅 http://msdn.microsoft.com/en-us/library/system.datetime .dayofweek.aspx [ ^ ]).
Just use the DateTime DayOfWeek property to get the value.
See http://msdn.microsoft.com/en-us/library/system.datetime.dayofweek.aspx[^] for more details.




您可以使用以下代码进行检查,

Hi,

you may check with below code,

DateTime dt = DateTime.Parse("your first column value");
string str = dt.ToString("dddd");
// Assign str value in your second row cell.



希望对您有帮助,

谢谢
-Amit.



hope this will help you,

thanks
-Amit.


这篇关于如何在数据网格视图中生成其关联日期的日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆