1
我無法更改telerik datepicker中的日期格式。 我在嘗試下面的過程。 我發現從This link在Telerik RadDatePicker中更改日期格式WPF
public class TelerikDateFormatWorkaround
{
public CultureInfo CultureWithSwissFormat
{
//Hack to get around the fact that there is no custom date format in the Telerik DatePicker
//http://www.telerik.com/community/forums/wpf/datepicker/changing-dateformat.aspx
get
{
var tempCultureInfo = (CultureInfo) CultureInfo.CurrentCulture.Clone();
tempCultureInfo.DateTimeFormat.ShortDatePattern = "dd.MM.yyyy";
return tempCultureInfo;
}
}
}
<Window.Resources>
<Style TargetType="telerik:RadDatePicker">
<Setter Property="Culture" Value="{Binding Source={StaticResource TelerikDateFormatWorkaround}, Path=CultureWithSwissFormat}"/>
</Style>
</Window.Resources>
下面的代碼,但錯誤的是The TelerikDateFormatWorkaround was not found.
你能幫助我嗎?
注意您鏈接狀態樣品中評論「將它添加到該用戶控件資源」。你在做什麼?代碼段是什麼樣的? –
在'TargetType =「telerik:RadDatePicker」' –