hi
How to localization the calendar in the filter radgridview
image atached
thanks
1 Answer, 1 is accepted
To localize RadGridView to display control text and messages in a specific language, it requires creating a descendant of the RadGridLocalizationProvider class. Then, override the GetLocalizedString(string id) method and provide a translation for the label and user messages:
https://docs.telerik.com/devtools/winforms/controls/gridview/localization/localization
public class MyEnglishRadGridLocalizationProvider : RadGridLocalizationProvider
{
public override string GetLocalizedString(string id)
{
switch (id)
{
case RadGridStringId.FilterFunctionToday:
return "TodayEN";
case RadGridStringId.FilterFunctionYesterday:
return "YesterdayEN";
}
return base.GetLocalizedString(id);
}
}
RadGridLocalizationProvider.CurrentProvider = new MyEnglishRadGridLocalizationProvider();
InitializeComponent();
System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("de-DE");
I hope this information helps. If you need any further assistance please don't hesitate to contact me.
Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
Hello, how can I access its calander(filter) properties
for change properties like zoomlevel
this code not work
private void radGridViewListAllPeriodDetail_CellBeginEdit(object sender, GridViewCellCancelEventArgs e) { RadDateTimeEditor editor; RadDateTimeEditorElement element; editor = this.radGridViewListAllPeriodDetail.ActiveEditor as RadDateTimeEditor; element = editor.EditorElement as RadDateTimeEditorElement; RadDateTimePickerCalendar calendarBehavior = element.GetCurrentBehavior() as RadDateTimePickerCalendar; RadCalendar calendar = calendarBehavior.Calendar as RadCalendar; calendar.HeaderNavigationMode = HeaderNavigationMode.Zoom; }
RadGridView offers the CellEditorInitialized event which fires when the editor is already activated and initialized. It is the appropriate place to apply any changes to the editor and adjust any property settings. The GridViewCellEventArgs gives you access to the ActiveEditor and the initial Value.
private void RadGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e)
{
RadDateTimeEditor editor = e.ActiveEditor as RadDateTimeEditor;
RadDateTimeEditorElement element = editor.EditorElement as RadDateTimeEditorElement;
RadDateTimePickerCalendar calendarBehavior = element.GetCurrentBehavior() as RadDateTimePickerCalendar;
RadCalendar calendar = calendarBehavior.Calendar as RadCalendar;
calendar.HeaderNavigationMode = HeaderNavigationMode.Zoom;
}
private void RadGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e) { RadDateTimeEditor editor = e.ActiveEditor as RadDateTimeEditor; RadDateTimeEditorElement element = editor.EditorElement as RadDateTimeEditorElement; RadDateTimePickerCalendar calendarBehavior = element.GetCurrentBehavior() as RadDateTimePickerCalendar; RadCalendar calendar = calendarBehavior.Calendar as RadCalendar; calendar.HeaderNavigationMode = HeaderNavigationMode.Zoom; }
but this code not work
image atached
Please excuse me for the misunderstanding. The previously provided code snippet is applicable for the editor which is activated when the cell enters edit mode. However, for the Excel-Like filter popup, the FilterPopupInitialized event is the appropriate place:
private void RadGridView1_FilterPopupInitialized(object sender, FilterPopupInitializedEventArgs e)
{
RadDateFilterPopup filterPopup = e.FilterPopup as RadDateFilterPopup;
if (filterPopup != null)
{
filterPopup.CalendarItem.CalendarElement.Calendar.HeaderNavigationMode = HeaderNavigationMode.Zoom;
}
}