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

Add Expression for Date(s)

7 Answers 49 Views
Filter
This is a migrated thread and some comments may be shown as answers.
rik butcher
Top achievements
Rank 1
rik butcher asked on 04 May 2012, 07:04 PM

can someone tell me how to do this same thing but, make it for a DATE CONTROL??
and of course not a StartsWith but an Equals

 

 

 

RadFilterStartsWithFilterExpression expr1 = new RadFilterStartsWithFilterExpression("LOGDISPLAY");

 

expr1.Value =

 

"";

 

UnreportedItemsRadFilter.RootGroup.AddExpression(expr1);

UnreportedItemsRadFilter.RecreateControl();

7 Answers, 1 is accepted

Sort by
0
rik butcher
Top achievements
Rank 1
answered on 06 May 2012, 06:47 PM
again i was able to fix this one.
thanks again
rik

 RadFilterEqualToFilterExpression<DateTime> expr1 = new RadFilterEqualToFilterExpression<DateTime>("DATEIN");
               expr1.Equals(System.DateTime.Now);
                SearchExitedTrucksRadFilter.RootGroup.AddExpression(expr1);
0
rik butcher
Top achievements
Rank 1
answered on 17 Jun 2013, 02:45 PM
i use this in the preRender of a RadFilter: and it works great, i'd like to 1. have the selected date be the current date when the calendar comes up be highlighted RED.
and 2. can i do this without using:  picker.SelectedDate = System.DateTime.Now;
thanks for any help on this
rik

 

 

foreach (var picker in ControlsOfType<RadDateTimePicker>(sender as Control))

 

{

picker.DateInput.DateFormat =

 

"MM/dd/yyyy";

 

picker.DateInput.DisplayDateFormat =

 

"MM/dd/yyyy";

 

}

0
Vasil
Telerik team
answered on 20 Jun 2013, 08:10 AM
Hi rik,

Yes you can achieve it without using the SelectedDate. There is an example in this online demo:
http://demos.telerik.com/aspnet-ajax/calendar/examples/functionality/today/defaultcs.aspx
Examine the code and let us know if you need further assistance.

Regards,
Vasil
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.
0
rik butcher
Top achievements
Rank 1
answered on 20 Jun 2013, 11:32 AM
jj
0
rik butcher
Top achievements
Rank 1
answered on 20 Jun 2013, 11:37 AM
i
0
rik butcher
Top achievements
Rank 1
answered on 20 Jun 2013, 11:38 AM

sorry for the short posts. i had to be in compatibility mode to post.
i had gone to the tutorial before that's why i was asking. I'd like the selected date to be the current date when the calendar comes up be highlighted RED and show today's date.
guys i simply can't find that in the tutorial.
here's the mark up and the preRender of that rad filter

 <telerik:RadFilter ID="SearchAllOrdersRadFilter" runat="server" Skin="WebBlue" ShowApplyButton="true"
                        OnPreRender="SearchAllOrdersRadFilter_PreRender" OnApplyExpressions="SearchAllOrdersRadFilter_Apply"
                        OnFieldEditorCreating="RadFilter_FieldEditorCreating" ApplyButtonText="Filter Work Orders" OnItemCommand="SearchAllOrdersRadFilter_ItemCommand">
                        <FieldEditors>
 <telerik:RadFilterDateFieldEditor FieldName="CREATEDDATE" DisplayName="Created Date"
                                DataType="System.DateTime" MinDate="1/1/1900" />

</FieldEditors>

IN PRERENDER:

  protected void SearchAllOrdersRadFilter_PreRender(object sender, EventArgs e)
        {
            RadContextMenu menu = SearchAllOrdersRadFilter.FindControl("rfContextMenu") as RadContextMenu;
            SearchAllOrdersRadFilter.RootGroupItem.Controls[2].Controls[1].Visible = false;
            menu.DefaultGroupSettings.Height = Unit.Pixel(250);
            menu.EnableAutoScroll = true;
           
            foreach (var picker in ControlsOfType<RadDateTimePicker>(sender as Control))
            {
                picker.DateInput.DateFormat = "MM/dd/yyyy";
                picker.DateInput.DisplayDateFormat = "MM/dd/yyyy";
            }
        }

0
Vasil
Telerik team
answered on 20 Jun 2013, 12:11 PM
Hello Rik,

You can create the special days programmatically in the code behind as shown in this help topic:
http://www.telerik.com/help/aspnet-ajax/calendar-day-templates.html

If you like other hightailing color than the normal rcToday based on the current skin, you can use different CSS Class (for example rcTodayMy) for the special day, and define your own CSS like this:

.RadCalendar_WebBlue .rcRow .rcTodayMy a {
    border-bottom-color: red;
    border-left-color-ltr-source: physical;
    border-left-color-rtl-source: physical;
    border-left-color-value: red;
    border-right-color-ltr-source: physical;
    border-right-color-rtl-source: physical;
    border-right-color-value: red;
    border-top-color: red;
    box-shadow: 0 0 0 1px red inset;
}


Regards,
Vasil
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
rik butcher
Top achievements
Rank 1
Answers by
rik butcher
Top achievements
Rank 1
Vasil
Telerik team
Share this question
or