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

How to choose between DateTimePicker and DatePicker in a MVC Razor Grid

1 Answer 59 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Stephan Kühn
Top achievements
Rank 1
Stephan Kühn asked on 24 Nov 2011, 09:36 PM
I have set up a page using the Telerik MVC Grid to display a list of products. Each product that has been launched has a launch date, but upcoming products have none. I have finally managed to get the launch date displayed in German format (i.e. dd.mm.yyyy). I am looking for a way to tell my column it should use a datepicker, not a datetimepicker as edit control.
How may I achieve this?

1 Answer, 1 is accepted

Sort by
0
Igniter
Top achievements
Rank 1
answered on 25 Nov 2011, 10:28 AM
You should use corresponding attribute in your class

[DataType(DataType.Date)]
public DateTime SomeDate { get; set; }


or

[DataType(DataType.DateTime)]
public DateTime SomeDateAndTime { get; set; }
Tags
Grid
Asked by
Stephan Kühn
Top achievements
Rank 1
Answers by
Igniter
Top achievements
Rank 1
Share this question
or