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

radfilter date only /time only

5 Answers 133 Views
Filter
This is a migrated thread and some comments may be shown as answers.
JJ
Top achievements
Rank 1
JJ asked on 30 May 2013, 08:13 PM

When using radfilter in radwindow like the following example, This radwindow/radfilter is shared my all the gird filter through my site.

http://demos.telerik.com/aspnet-ajax/filter/examples/filterinradwindow/defaultcs.aspx

If I have GridDateTimeColumn on the grid and have TimePicker and DatePicker as PickerType for separate column, On the filter, how can I check the GridDateTimeColumn PickerType to show date only (no time icon) when PickerType is DatePicker and show time only ( no date icon) when PickerType is TimePicker ?

Thanks

5 Answers, 1 is accepted

Sort by
0
Antonio Stoilkov
Telerik team
answered on 04 Jun 2013, 08:07 AM
Hi,

I have assembled a sample page showing the desired functionality implemented. The idea is to subscribe to RadFilter FieldEditorCreated event and set the editor PickerType value depending on the column PickerType as shown below.
protected void RadFilter1_FieldEditorCreated(object sender, RadFilterFieldEditorCreatedEventArgs e)
{
    if (e.Editor.FieldName == "DateTime")
    {
        RadFilterDateFieldEditor editor = e.Editor as RadFilterDateFieldEditor;
        string pickerTypeAsString = (RadGrid1.MasterTableView.GetColumn("DateTime") as GridDateTimeColumn).PickerType.ToString();
        editor.PickerType = (RadFilterDateFieldEditorPickerType)Enum.Parse(typeof(RadFilterDateFieldEditorPickerType), pickerTypeAsString);
    }
}

Regards,
Antonio Stoilkov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Marcus
Top achievements
Rank 1
answered on 25 Jun 2013, 10:40 PM
Umm ... Antonio:

RadFilterDateFieldEditor class (-> editor) does not contain a definition for "PickerType".
Also: what namespace is RadFilterDateFieldEditorPickerType contained in?

using v2013.1.220.40

Thx in advance!
M.
0
Shinu
Top achievements
Rank 2
answered on 26 Jun 2013, 05:55 AM
Hi Marcus,

The RadFilterDateFieldEditorPickerType is contained in the Telerik.Web.UI namespace. I have tried the same code which works fine in the latest version(2013.2.611.40) of Telerik RadControls for ASP.NET AJAX whereas it didn't worked in the previous release like what you described. So update your RadControls to the latest version.

Thanks,
Shinu.
0
Marcus
Top achievements
Rank 1
answered on 02 Jul 2013, 09:46 PM
Shinu,

thx for your reply. It seems I don't have access to the latest build (subscription expired in June).
Is there a way to do this client-side? I though I saw an example for that somewhere, but I can't find it anymore.

Thx in advance!
M.
0
Antonio Stoilkov
Telerik team
answered on 05 Jul 2013, 07:19 AM
Hi,

In order to achieve your scenario without the latest version you could create a custom RadFilter editor and in the InitializeEditor place a RadDatePicker. The help article below describes how a RadFilter custom editor could be created.

Regards,
Antonio Stoilkov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Filter
Asked by
JJ
Top achievements
Rank 1
Answers by
Antonio Stoilkov
Telerik team
Marcus
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Share this question
or