sureshcd10 Posted December 16, 2005 Posted December 16, 2005 Hi all, I want my dataGrid to display time like the following in an asp.net webform: TIME 00:00 00:30 01:00 01:30 02:00 . . . 23:00 plz help me how can I do this Thanking you all Quote ima
college_amy Posted December 20, 2005 Posted December 20, 2005 Since they are set times, why don't you store them in a database and bind it to a column? Assuming you are doing a scheduling type function anyways - you will probably save the time somewhere, would that work for you? Amy Hi all, I want my dataGrid to display time like the following in an asp.net webform: TIME 00:00 00:30 01:00 01:30 02:00 . . . 23:00 plz help me how can I do this Thanking you all Quote
sureshcd10 Posted December 29, 2005 Author Posted December 29, 2005 Thank u for your help. I solved the problem by using the following piece of code Dim dr As DataRow Dim i As Integer Dim strdate As DateTime strdate = Today() tmpUser = New DataTable For i = 0 To 47 dr = tmpUser.NewRow() If (i = 0) Then dr(0) = "" & Mid(String.Format("{0:u}", strdate), 12, 5) Else strdate = strdate.AddMinutes(30) dr(0) = "" & Mid(String.Format("{0:u}", strdate), 12, 5) End If tmpUser.Rows.Add(dr) Next MyGrid.DataSource = tmpUser MyGrid.DataBind() Quote ima
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.