GridViewDateTimeColumn Footer Date Format

2 posts, 1 answers
  1. Matthew Compton
    Matthew Compton avatar
    7 posts
    Member since:
    Aug 2012

    Posted 28 Sep 2012 Link to this post


    I'm having a hard time changing the format in the footer of the Calender.   How can I set the format to {0:yyyy-MM-dd}?

  2. Answer
    Stefan avatar
    2906 posts

    Posted 29 Sep 2012 Link to this post

    Hello Mattew,

    Thank you for writing

    To change the format of the footer in the calendar you need to subscribe to the CellEditorInitialized event of the grid, from where you can access the date time editor and from there the calendar:
    void radGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e)
        RadDateTimeEditor editor = e.ActiveEditor as RadDateTimeEditor;
        if (editor != null)
            RadDateTimeEditorElement element = editor.EditorElement as RadDateTimeEditorElement;
            RadDateTimePickerCalendar calendarBehavior = element.GetCurrentBehavior() as RadDateTimePickerCalendar;
            RadCalendar calendar = calendarBehavior.Calendar as RadCalendar;
            calendar.CalendarElement.CalendarStatusElement.LableFormat = "dd/mmm/yyyy";

    I hope this helps.
    the Telerik team
    RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
Back to Top