Matthew Compton
Top achievements
Rank 1
Matthew Compton
asked on 27 Apr 2012, 04:25 PM
I have 4 DateTime Fields in my RadGridView. StartDate, StartTime, EndTime, EndDate. I need to be able to have a Time only picker when adding / editing in the grid. I can't seem to find a way to use the RadTimePicker. Is there a way to integrate this? Or use the GridViewDateTimeColumn in such a manner?
I'm Using WinForms Q1 2012 (2012.1.12.215) in a .NET 4.0 framework project.
Thanks. Matthew
I'm Using WinForms Q1 2012 (2012.1.12.215) in a .NET 4.0 framework project.
Thanks. Matthew
5 Answers, 1 is accepted
0
Accepted
Hello Matthew,
Thank you for writing.
To achieve the desired behavior, you need to create a custom editor, based on RadTimePickerElement. In the attached project, you can find such an editor implemented. Feel free to customize and use it in your application.
I hope that you find this information useful. Let us know if you have any other questions.
Regards,
Stefan
the Telerik team
Thank you for writing.
To achieve the desired behavior, you need to create a custom editor, based on RadTimePickerElement. In the attached project, you can find such an editor implemented. Feel free to customize and use it in your application.
I hope that you find this information useful. Let us know if you have any other questions.
Regards,
Stefan
the Telerik team
RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
0
Matthew Compton
Top achievements
Rank 1
answered on 02 May 2012, 06:35 PM
Thanks, that works but has changed all the pickers in the grid to a time picker.
I have two Fields that still require a DatePicker. Can i use both in a the same gridview?
Also, How do I force the time picker to use the 24 hour clock format?
Thanks for your help. Matthew
I have two Fields that still require a DatePicker. Can i use both in a the same gridview?
Also, How do I force the time picker to use the 24 hour clock format?
Thanks for your help. Matthew
0
Hellow Matthew,
Thank you for writing back.
Indeed, the project changes all RadDateTimeEditors to TimePickerEditors. However, you can always check the CurrentColumn of the grid and change the editor type according it. I have changed the implementation of the desired functionality to use the embedded time picker editor instead of a custom one. Attached you can find a sample demonstrating how to use this approach, together with how to format the editor's time to 24 hour format. Then, if you want to set the cells format to 24 hour too, use the FormatString property of the column:
Let me know how it works for you.
Greetings,
Stefan
the Telerik team
Thank you for writing back.
Indeed, the project changes all RadDateTimeEditors to TimePickerEditors. However, you can always check the CurrentColumn of the grid and change the editor type according it. I have changed the implementation of the desired functionality to use the embedded time picker editor instead of a custom one. Attached you can find a sample demonstrating how to use this approach, together with how to format the editor's time to 24 hour format. Then, if you want to set the cells format to 24 hour too, use the FormatString property of the column:
col.FormatString =
"{0:HH:mm}"
;
Let me know how it works for you.
Greetings,
Stefan
the Telerik team
RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
0
Matthew Compton
Top achievements
Rank 1
answered on 09 May 2012, 05:54 PM
Thanks, that did the trick as well. One final question. Is it possible to change the interval on the minute picker? For instance change from every 5 minutes to every 1 minute.
0
Accepted
Hello Matthew,
Yes, you can do that by setting the Step property of the element:
I hope this helps.
All the best,
Stefan
the Telerik team
Yes, you can do that by setting the Step property of the element:
element.Step = 1;
I hope this helps.
All the best,
Stefan
the Telerik team
RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>