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
thanks again
rik
RadFilterEqualToFilterExpression<DateTime> expr1 = new RadFilterEqualToFilterExpression<DateTime>("DATEIN");
expr1.Equals(System.DateTime.Now);
SearchExitedTrucksRadFilter.RootGroup.AddExpression(expr1);
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";
}
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
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";
}
}
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