Add Expression for Date(s)

8 posts, 0 answers
  1. rik butcher
    rik butcher avatar
    106 posts
    Member since:
    Jul 2009

    Posted 04 May 2012 Link to this post

    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();

  2. rik butcher
    rik butcher avatar
    106 posts
    Member since:
    Jul 2009

    Posted 06 May 2012 Link to this post

    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);
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. rik butcher
    rik butcher avatar
    106 posts
    Member since:
    Jul 2009

    Posted 17 Jun 2013 Link to this post

    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";

     

    }

  5. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 20 Jun 2013 Link to this post

    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.
  6. rik butcher
    rik butcher avatar
    106 posts
    Member since:
    Jul 2009

    Posted 20 Jun 2013 Link to this post

    jj
  7. rik butcher
    rik butcher avatar
    106 posts
    Member since:
    Jul 2009

    Posted 20 Jun 2013 Link to this post

    i
  8. rik butcher
    rik butcher avatar
    106 posts
    Member since:
    Jul 2009

    Posted 20 Jun 2013 Link to this post

    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";
                }
            }

  9. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 20 Jun 2013 Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017