This is a migrated thread and some comments may be shown as answers.

GridViewDateTimeColumn Dropdown Calendar showing "Footer"

5 Answers 157 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Dev J
Top achievements
Rank 1
Dev J asked on 27 Apr 2010, 09:15 PM
Just a note to everyone out there. We just upgraded to Q1 2010 and suddenly the drop-down calendar on all GridViewDateTimeColumn columns in our RadGridViews started showing a "footer" (displays the current date/time and has "Clear" and "Now" buttons). None of the other similar controls (RadDateTimePicker, etc.) are doing this. This made the UI inconsistent, so I came up with code to hide the "footer" for GridViewDateTime columns:

 

    Private Sub rgvGrid_CellEditorInitialized(ByVal sender As Object, _  
                                              ByVal e As Telerik.WinControls.UI.GridViewCellEventArgs) _  
                                              Handles rgvGrid.CellEditorInitialized  
 
        If TypeOf rgvNotes.CurrentColumn Is GridViewDataColumn Then  
 
            Select Case DirectCast(rgvNotes.CurrentColumn, GridViewDataColumn).UniqueName  
 
                Case "SomeColumnName"  
 
                    Dim activeEditor As RadDateTimeEditor = TryCast(rgvNotes.ActiveEditor, RadDateTimeEditor)  
 
                    If activeEditor IsNot Nothing Then  
 
                        Dim editorElement As RadDateTimeEditorElement _ 
                            = TryCast(activeEditor.EditorElement, RadDateTimeEditorElement)  
 
                        If editorElement IsNot Nothing Then  
 
                            Dim dateTimePickerCalendar As RadDateTimePickerCalendar _ 
                                = TryCast(editorElement.GetCurrentBehavior(), RadDateTimePickerCalendar)  
 
                            If dateTimePickerCalendar IsNot Nothing Then  
 
                                dateTimePickerCalendar.Calendar.ShowFooter = False 
 
                            End If  
 
                        End If  
 
                    End If  
 
            End Select  
 
        End If  
 
    End Sub
 

5 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 03 May 2010, 05:30 PM
Hi Dev J,

Thank you for your feedback.

We decided to change the default behavior in RadGridView due to the numerous requests concerning Clear and Now buttons visible by default. Your Telerik points have been updated for your community effort.

If you have additional feedback to share, feel free to contact me.

Regards,
Nikolay
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Robert
Top achievements
Rank 1
answered on 20 Jan 2011, 12:09 PM
But what if I would like to show the footer on my GridViewDateTimeColumn whenever it is droped down ?

I am using Q1 2009 and I cant see 'activeEditor.EditorElement' in my RadDateTimeEditor class ?
And also plese tell me whether I can show a list of years like from 2000 to 2010 on my calender somewhere?

Please help...

Robert
0
Nikolay
Telerik team
answered on 24 Jan 2011, 11:54 AM
Hi Robert,

Actually, the footer of RadDateTimePicker in RadGridView is shown by default in our latest version. The Clear button, however, is not visible by default. If you want to show it, you can do it as demonstrated below:
void radGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e)
{
    RadDateTimeEditor editor = this.radGridView1.ActiveEditor as RadDateTimeEditor;
    if (editor != null)
    {
        RadDateTimeEditorElement editorElement = (RadDateTimeEditorElement)editor.EditorElement;
        RadDateTimePickerCalendar calendarBehavior = editorElement.GetCurrentBehavior() as RadDateTimePickerCalendar;
        RadCalendar calendar = calendarBehavior.Calendar as RadCalendar;
        RadCalendarElement calendarElement = calendar.CalendarElement as RadCalendarElement;
        calendarElement.CalendarStatusElement.ClearButton.Enabled = true;
        calendarElement.CalendarStatusElement.ClearButton.Visibility = Telerik.WinControls.ElementVisibility.Visible;
    }
}

Please note that the above code snippet will work only with the latest versions of RadControls for WinForms. I would recommend updating to our latest release Q3 2010 SP1 (v2010.3.10.1215). You should be able to immediately notice the improvements that we have made during the last two years.

As to the year list, RadCalendar does not support this feature. You can find the PITS item for this task here. In case it gathers enough votes, we will consider implementing it in one of our next versions.

If you have additional questions, feel free to contact us.

All the best,
Nikolay
the Telerik team
Q3’10 SP1 of RadControls for WinForms is available for download; also available is the Q1'11 Roadmap for Telerik Windows Forms controls.
0
Robert
Top achievements
Rank 1
answered on 24 Jan 2011, 01:51 PM
Hi Nikolay,

Many thanks for your reply, but I would like to let you know that I am using quite a lot of controls in one project but if I upgrade it to the latest version how many thing would it change in the previous controls and how would it effect the previous controls because I dont want to get into a big hassle upgrading these controls.

And this code is almost useless with Q1 2009 because as I mentioned earlier I cant see 'editor.EditorElement'  in RadDateTimeEditor class.

Please advice what should I do?

Many thanks,

Robert
0
Nikolay
Telerik team
answered on 24 Jan 2011, 02:30 PM
Hi Robert,

The changes that we have introduced during the last two years are listed in our Release Notes. The breaking changes are marked in red for better readability. I would suggest that you update your project as soon as possible, because the longer you wait, the more difficult the upgrade process might be. In addition, according to our general policy, we do not support versions older than one year.

If you do not have the time to update now, we will make an exception for you and will provide you with assistance for your enquiry. Please note, however, that in this case I would kindly ask you to ask the purchase holder of your license to add you as a license developer. Once we verify the status of your account, we provide you with the solution to your question about the footer in RadDateTimeEditor.

All the best,
Nikolay
the Telerik team
Q3’10 SP1 of RadControls for WinForms is available for download; also available is the Q1'11 Roadmap for Telerik Windows Forms controls.
Tags
GridView
Asked by
Dev J
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Robert
Top achievements
Rank 1
Share this question
or