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

Get all Time Collections list from Rad time picker in codebehind

2 Answers 110 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Thenmozhi
Top achievements
Rank 1
Thenmozhi asked on 11 Jan 2011, 03:47 PM
Hi,

I have a rad time picker in my application.

I am setting start and end time using the radtimepicker.timeview.starttime and endtime .

And as mentioned above i can able to set the interval as well.

On button click i have to get the all items from the radtimepicker and have to insert into database.

Can any one suggest me how to get the time collection from the radtimepicker timeview.

Thanks
Thenmozhi

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 12 Jan 2011, 11:06 AM
Hello,

I am not sure about any direct method available for getting the TimeSpan for TimeView. But I tried following code.

Code:
protected void Button1_Click(object sender, EventArgs e)
{
    TimeSpan span = (TimeSpan)RadTimePicker1.TimeView.StartTime;
    TimeSpan interval = (TimeSpan) RadTimePicker1.TimeView.Interval;
    double seconds = RadTimePicker1.TimeView.EndTime.TotalSeconds;
    while (span.TotalSeconds < seconds)
    {          
        string str = span.ToString(); // get the span
        Response.Write(str);
        span = span.Add(interval);
    }
}




-Shinu.
0
Thenmozhi
Top achievements
Rank 1
answered on 12 Jan 2011, 11:46 AM
Hi Shinu,

Thanks for your response.

Actually i awaited for the response for a while.

I have got the list using the below code and completed my task.

 do
        {
           
            dtstart=dtstart.AddMinutes(duration);


        } while (dtstart < dtend);
Tags
Calendar
Asked by
Thenmozhi
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Thenmozhi
Top achievements
Rank 1
Share this question
or