This is a migrated thread and some comments may be shown as answers.

RadTimePicker in Grid

2 Answers 107 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Chandrasekhar
Top achievements
Rank 1
Chandrasekhar asked on 07 Mar 2012, 03:28 PM
Hi Team,

I'm using RadTimePicker in ASP.NET Grid. My requirement is need to display start time 30 mins increment and End time 30 decrement in TimeView based on current time in the grid.

Kindly suggest.

Thanks in advance.

2 Answers, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 12 Mar 2012, 09:22 AM
Hi,

In order to give you suggestion I will need more information about your project. Could you share your RadGrid declaration along with the respective event handlers? Doing this will help all the people who want to help you to have better understanding of your project. Additionally, please specify to which columns you wish to bind the Start and End times.

Regards,
Andrey
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Chandrasekhar
Top achievements
Rank 1
answered on 12 Mar 2012, 09:54 AM
Thanks for your reply.

Able to solve above problem.

Here is my solution : To display 30 mins increment from current TimePicker view for the asp.net Grid.

            Dim l_timepickerStartTime As RadTimePicker
            Dim l_selectedDateStartTime  As DateTime
            Dim l_selectedDateStartTimeHour As Integer
            Dim l_selectedDateStartTimeMinutes As Integer

             l_timepickerStartTime = CType(dgrdStoreClosure.Rows(e.NewEditIndex).Cells(3).FindControl("RadTimePicker1"), RadTimePicker)
              l_selectedDateStartTime = Format(l_timepickerStartTime.DbSelectedDate, "t")
                l_selectedDateStartTimeHour = l_selectedDateStartTime.Hour
                l_selectedDateStartTimeMinutes = l_selectedDateStartTime.Minute

 If l_selectedDateStartTimeMinutes.Equals(0) Then
                l_timepickerStartTime.TimeView.StartTime = New TimeSpan(l_selectedDateStartTimeHour, 30, 0)
            Else
                l_timepickerStartTime.TimeView.StartTime = New TimeSpan(l_selectedDateStartTimeHour + 1, 0, 0)
            End If

Similarly way for 30 minutes decrement for EndTime.

Kindly let me know for any changes in the above code.

Thanks
Chandrasekhar Reddy

Tags
Grid
Asked by
Chandrasekhar
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Chandrasekhar
Top achievements
Rank 1
Share this question
or