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

GridDateTimeColumn EnableRangeFiltering defaults

3 Answers 56 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Marco
Top achievements
Rank 1
Marco asked on 14 Apr 2015, 01:42 PM

I would like to know how to set the defaults of the From and To dates in a GridDateTimeColumn with EnableRangeFiltering="true".

My questions are in particular:

1) how do I set the From and To dates, and which date format should I use when setting them (dd/mm/yyyy, mm/dd/yyyy or yyyy/mm/dd) and which separator (/, - or .)?

2) how do I set the filter to be *between* the From/To dates and don't let the user to change it (not the dates, the type of filter)?

If there is a documentation page where these questions are answered then could you please share the link to it?

3 Answers, 1 is accepted

Sort by
0
Marco
Top achievements
Rank 1
answered on 15 Apr 2015, 01:46 PM

I think I figured it out by myself. 

1) First put the following inside the telerik:GridDateTimeColumn tag:

UniqueName="CancelDate" EditDataFormatString="dd.mm.yyyy"

and this in the code behind:

GridColumn date = RadGrid1.MasterTableView.GetColumnSafe("Date");
date.CurrentFilterValue = string.Format("{0} {1}", From.ToShortDateString(), To.ToShortDateString());

2) Put the following inside the telerik:GridDateTimeColumn tag:

ShowFilterIcon="false" CurrentFilterFunction="Between"

0
Maria Ilieva
Telerik team
answered on 17 Apr 2015, 10:20 AM
Hello Marco,

I'm glad that you were able to develop the required functionality on your end. Do let us know if further assistance is needed.

Regards,
Maria Ilieva
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
Jaya
Top achievements
Rank 1
answered on 22 Apr 2015, 06:20 AM

Hi

Admin

Can you solve this 

http://www.telerik.com/forums/how-to-designed-the-aspx-page-and-open-rad-window
Tags
Grid
Asked by
Marco
Top achievements
Rank 1
Answers by
Marco
Top achievements
Rank 1
Maria Ilieva
Telerik team
Jaya
Top achievements
Rank 1
Share this question
or