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

How to Show a Time Picker in Column Filter

1 Answer 173 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ric
Top achievements
Rank 1
Ric asked on 25 Nov 2011, 05:03 AM
Hi Telerik Team,

As captioned. We found that the Column Filter can only show DatePicker. We want a TimePicker instead.
Please find the attached screen capture for details.

Thanks
Ric Yik

1 Answer, 1 is accepted

Sort by
0
Accepted
Maya
Telerik team
answered on 25 Nov 2011, 08:58 AM
Hi Ric,

You can handle FieldFilterEditorCreated event of RadGridView and based on the corresponding column to find the editor. If the underlying property of of DateTime type, this editor will be RadDateTimePicker. This control has InputMode property that could be set to 'DatePicker', 'TimePicker' and 'DateTimePicker'. The default value of the filter is DatePicker, but you can easily change it as follows:

private void clubsGrid_FieldFilterEditorCreated(object sender, Telerik.Windows.Controls.GridView.EditorCreatedEventArgs e)
        {
            if(e.Column.UniqueName == "Established")
            {
                RadDateTimePicker editor = e.Editor as RadDateTimePicker;
                editor.InputMode = Telerik.Windows.Controls.InputMode.DateTimePicker;
            }
             
        }

 

Kind regards,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
GridView
Asked by
Ric
Top achievements
Rank 1
Answers by
Maya
Telerik team
Share this question
or