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

[Solved] RadDateTimeColumn TimePicker

2 Answers 140 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Syed M Ali Shah
Top achievements
Rank 1
Syed M Ali Shah asked on 02 Sep 2009, 01:20 PM
Hi,

I have following datetime column:

<

 

telerik:GridDateTimeColumn PickerType="TimePicker" DataField="DrivingMinutesFromLastCity" HeaderText="Driving Time (MM)"

 

 

SortExpression="DrivingMinutesFromLastCity" DataType="System.DateTime" UniqueName="DrivingMinutesFromLastCity" DataFormatString="{0:HH:mm}" >

 

 

</telerik:GridDateTimeColumn>

 


now in the edit / insert form I have to enter only minutes in the form of HH:MM e.g. 00:50 . But in edit mode I have a small timeview button and when i type time 00:50 and press tab it converts it into 12:50 AM on the edit form. Time is represented in correct format (hh:mm) in the grid because i have setup dataformatstring. Now two questions:
1) How can I remove that TimeView button in the Edit mode?
2) How can I setup the input format for datetimecolumn , so that it should enter the time as it is entered e.g. 00:50 and not 12:50 AM.

Your help in this will be highly appreciated.

Cheers,
Ali

2 Answers, 1 is accepted

Sort by
0
Mr. Plinko
Top achievements
Rank 1
answered on 02 Sep 2009, 03:18 PM
Why don't you do a masked column, since the user enters their own numbers?

 <telerik:GridMaskedColumn 
 UniqueName="Time" 
 HeaderText="Time" 
 DataField="Time" 
 Mask="##:##" />  


Helpful?
0
Syed M Ali Shah
Top achievements
Rank 1
answered on 04 Sep 2009, 01:58 AM
Hi,
Thanks for your help, but problem is that when i try to edit the masked column it does not reterieve the values from the grid.
e.g. if the grid is showing time in minutes such that 00:15, when i edit this row, it shows mein 9_:__ . i can't understand why is it like this.?
i have set maskedgridcolumn mask="##:##" for time
is there any other way?
cheers, Ali
Tags
Grid
Asked by
Syed M Ali Shah
Top achievements
Rank 1
Answers by
Mr. Plinko
Top achievements
Rank 1
Syed M Ali Shah
Top achievements
Rank 1
Share this question
or