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

Telerik.Windows.Controls.GridView FieldFilterEditorCreated event does not exist

1 Answer 45 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Dave
Top achievements
Rank 1
Dave asked on 27 Apr 2011, 11:01 PM
I would like to change a date column filter to display and input only the Time part. It looks like the FieldFilterEditorCreated event would work but it does not exist in this control. Is there an alternative?

1 Answer, 1 is accepted

Sort by
0
Accepted
Emanuel Varga
Top achievements
Rank 1
answered on 29 Apr 2011, 12:26 PM
Hello Daniel,

Yes, you can use the CellEditorInitialized event and do the following:
void radGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e)
{
    if (e.ActiveEditor is RadDateTimeEditor)
    {
        var dateTimeEditor = e.ActiveEditor as RadDateTimeEditor;
        if (dateTimeEditor != null)
        {
            var element = dateTimeEditor.EditorElement as RadDateTimeEditorElement;
            if (e.Row is GridViewFilteringRowInfo)
            {
                element.ShowUpDown = true;
                element.Format = DateTimePickerFormat.Time;
            }
            else
            {
                element.ShowUpDown = false;
                element.Format = DateTimePickerFormat.Long;
            }
        }
    }
}

Hope this helps, if you have any other questions or comments, please let me know,

Best Regards,
Emanuel Varga

Telerik WinForms MVP
Tags
GridView
Asked by
Dave
Top achievements
Rank 1
Answers by
Emanuel Varga
Top achievements
Rank 1
Share this question
or