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

    Hello,

    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}?

    Thanks.
  2. Answer
    Stefan
    Admin
    Stefan avatar
    2891 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.
     
    Greetings,
    Stefan
    the Telerik team
    RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top