This question is locked. New answers and comments are not allowed.
I have been trying to figure out how to hide the time portion of the RadDatePicker, when I am using it inside of a Grid. I have been looking at the picker help here: http://www.telerik.com/help/silverlight/raddatetimepicker-features-formatting.html but this doesn't work when it is in a GridView, or at least it isn't working for me.
I am using the control inside of a DataColumn, because I need to use the DisplayDateStart and DisplayDateEnd properties, so I cannot just use the basic DataColumn, without the picker control in it.
Here is my example code. Everything works great when you are editing the row in the grid, it doesn't show a time component. When you are not in edit mode in the cell, it shows the 12:00:00 AM part, which I don't want.
<telerik:GridViewDataColumn DataMemberBinding="{Binding ReportDate}"
EditTriggers="CellClick"
Header="Shift Date"
IsReadOnlyBinding="{Binding IsRowReadOnly}">
<telerik:GridViewDataColumn.CellEditTemplate>
<DataTemplate>
<telerik:RadDatePicker x:Name="rdpShiftDate"
DisplayDateEnd="{Binding DateRangeEnd}"
DisplayDateStart="{Binding DateRangeStart}"
InputMode="DatePicker"
SelectedValue="{Binding ReportDate,
Mode=TwoWay}" />
</DataTemplate>
</telerik:GridViewDataColumn.CellEditTemplate>
</telerik:GridViewDataColumn>
I have tried doing this in the C# and it doesn't change anything:
rdpShiftDate.Culture = new CultureInfo("en-US");
rdpShiftDate.Culture.DateTimeFormat.ShortDatePattern = "ddd, MMM dd, yyyy";
also tried this:
rdpShiftDate.Culture.DateTimeFormat.ShortDatePattern = "{0:ddd, MMM dd, yyyy}";
I am using the control inside of a DataColumn, because I need to use the DisplayDateStart and DisplayDateEnd properties, so I cannot just use the basic DataColumn, without the picker control in it.
Here is my example code. Everything works great when you are editing the row in the grid, it doesn't show a time component. When you are not in edit mode in the cell, it shows the 12:00:00 AM part, which I don't want.
<telerik:GridViewDataColumn DataMemberBinding="{Binding ReportDate}"
EditTriggers="CellClick"
Header="Shift Date"
IsReadOnlyBinding="{Binding IsRowReadOnly}">
<telerik:GridViewDataColumn.CellEditTemplate>
<DataTemplate>
<telerik:RadDatePicker x:Name="rdpShiftDate"
DisplayDateEnd="{Binding DateRangeEnd}"
DisplayDateStart="{Binding DateRangeStart}"
InputMode="DatePicker"
SelectedValue="{Binding ReportDate,
Mode=TwoWay}" />
</DataTemplate>
</telerik:GridViewDataColumn.CellEditTemplate>
</telerik:GridViewDataColumn>
I have tried doing this in the C# and it doesn't change anything:
rdpShiftDate.Culture = new CultureInfo("en-US");
rdpShiftDate.Culture.DateTimeFormat.ShortDatePattern = "ddd, MMM dd, yyyy";
also tried this:
rdpShiftDate.Culture.DateTimeFormat.ShortDatePattern = "{0:ddd, MMM dd, yyyy}";