Telerik Forums
UI for WinForms Forum
1 answer
26 views

Hi, I'm using a RadDataFilter to filter data on a RaGridView.

For datetime columns I've noticed some problems.

First, in the control the date is displayed in english format (see first attached image). When I try to change the value a datetimepicker appears and in this case the date is in italian format (according to my pc settings).

Second, I've noticed when the radDataFilter.Expression is generated the date is in english format, including time, and it is inside a couple of #, i.e the expression generated is like:

[myDate] >= #11/20/2023 14:55:07# 

I would like to have only the date without time, is it possible?
And  how can manage this expression to generate the SQL expression, cause the # is not accepted.

 

Thank you in advance for any help.

Nadya | Tech Support Engineer
Telerik team
 answered on 23 Nov 2023
3 answers
40 views

Hello,

I was wondering how to do the following on a DateTimePicker, if it is possible at all: apply one theme to the main control and another to its calendar.

Something like this:

RadDateTimePicker1.ThemeName = A


Dim calendarBehavior As RadDateTimePickerCalendar = TryCast(RadDateTimePicker1.DateTimePickerElement.GetCurrentBehavior(), RadDateTimePickerCalendar)
Dim calendar As RadCalendar = TryCast(calendarBehavior.Calendar, RadCalendar)

calendar.ThemeName = B
Thank you
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 10 Aug 2023
1 answer
45 views

Hi,

How can I change the selected text colour of a RadDateTimePicker?

I'm not sure if this is possible, I'm afraid the DateTimePicker uses a MaskedEditBox, which uses a RadTextBox, which in turn uses a normal TextBox from .Net... so in the end I don't think it can be done, am I right? If so, is there a viable alternative?

Also, why are most edit controls based on RadTextBox instead of RadTextBoxControl? Wouldn't it be better to use the latter and take advantage of the fact that it has more Telerik features built in?

Thanks.

Dinko | Tech Support Engineer
Telerik team
 answered on 08 Aug 2023
1 answer
48 views

I want to prevent the radDateTimePicker from getting focus with TabStop set to FALSE and the control is enabled. I can do this with TextBoxes and CheckBox, etc, but this control, no matter what I do, even if I set the internal controls to TabStop = false, the control still gets focus.  

 

Looking for a solution

TIA

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 08 Aug 2023
1 answer
145 views

hi

1-one columns(date) in grid view by formatinfo(fa-ir, yyyy, Mm, dd) view in run application

But Column date the output is in English

2-cell border  How it's set

3-what not show row number set by cell formatting in expory excel?

4--in pdf export rtl language not suport?

Dinko | Tech Support Engineer
Telerik team
 answered on 01 Jun 2022
1 answer
56 views

We were using the built-in windows DateTimePicker for all of our dates, and have changed to using RadDateTimePicker, and i am having a few issues/questions.

1. We have Overrides setup on KeyPressEventArgs to trap the ENTER key which then sends a TAB - so our users can just hit enter to move to the next field instead of being required to hit tab (this works on all data entry fields except raddatetimepicker).

2. The user is required to type in the full year. We have the format set to Short. Using standard windows DateTimePicker, the user could type 22 and it would make it 2022. But, if the user types 22 now, it just puts the 22 in the year. So if the year was 2003 and you type in 22, the year now becomes 0322. We want the year to be entered as 2 digits and use the current century. How would we do that?

3. We don't want the user to be able to clear out the date completely, we want a date to be entered. Windows didn't allow this (we never set min date values). I even set the NullDate to be "1/1/1901" and that made it when i "cleared out" the date it displayed 1/1/0001.

Thanks for your help.

Dinko | Tech Support Engineer
Telerik team
 answered on 09 Mar 2022
1 answer
106 views

hi

how show cell time like hh:mm

this code have error
GridViewDateTimeColumn column = (GridViewDateTimeColumn)this.radGridView1.Columns["Date"];

column.FormatString = "{0:hh.mm}";      //hour.minutes
thanks
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 24 Jan 2022
1 answer
69 views

hi

i have tow problem

1-how to change backcolor all friday(days) on calendar(datetimepicker)

my code not work


private void radDateTimePickerStart_ElementRender(object sender, RenderElementEventArgs e)
        {
            if (e.Day.Date.DayOfWeek==DayOfWeek.Friday)
            {
               
                e.Element.BackColor = Color.Red;


            }
           
        }

2-in atache image

title calendar not change CultureInfo("fa-IR", true);

Dinko | Tech Support Engineer
Telerik team
 answered on 07 Jan 2022
0 answers
68 views

hi

how handling error

System.ArgumentOutOfRangeException: 'Day must be between 1 and 29 for month 12.

Parameter name: day'

 

i try handling in key peress but show error

my cod is

 

                                        

public static bool CheckIsLeapYear(DateTime date)
        {
            PersianCalendar pc = new PersianCalendar();
            int year, day;
            year = pc.GetYear(date);
            day = pc.GetDayOfMonth(date);
            bool result = false;
            bool isleapyear = false;
            isleapyear = pc.IsLeapYear(year);
            if (isleapyear!=true && day>29)
            {
                result= true;


            }
            return result;



        }

 

----------------------------------------------------------------------------------------------------

 

 

 private void radDateTimePickerDateOfBirth_KeyDown(object sender, KeyEventArgs e)
        {
           

            
           
                if (CheckIsLeapYear(radDateTimePickerDateOfBirth.Value))
                {


       
                radDateTimePickerDateOfBirth.Value = DateTime.Now;
                 
                }
            }


ebrahim
Top achievements
Rank 1
Iron
Iron
 asked on 08 Dec 2021
1 answer
1.7K+ views

Hi.

After a date is picked I want to delete it and set the value to null on the data bound item.

The NullableValue is set to null/Nothing:

 Me.DateRadDateTimePicker.NullableValue = Nothing

The Value property is bound to an entity's nullable date field:

 Me.DateRadDateTimePicker.DataBindings.Add(New System.Windows.Forms.Binding("Value", Me.binder, "Date", True))

If I select the date text and delete it, the entity still has a 01/01/0001 date value. However, the null text correctly displays in the picker.

I've even tried to manually set the null date (in three different ways!) based on the empty text but to no avail:


Dim dtp As RadDateTimePicker = ctrl
If dtp.Text = "" Then
  dtp.NullableValue = Nothing
  dtp.DateTimePickerElement.SetToNullValue()
  dtp.Value = Nothing
End If

 

What am I missing?

Nadya | Tech Support Engineer
Telerik team
 answered on 23 Jun 2021
Narrow your results
Selected tags
Tags
GridView
General Discussions
Scheduler and Reminder
Treeview
Dock
RibbonBar
Themes and Visual Style Builder
ChartView
Calendar, DateTimePicker, TimePicker and Clock
Buttons, RadioButton, CheckBox, etc
DropDownList
ComboBox and ListBox (obsolete as of Q2 2010)
ListView
Chart (obsolete as of Q1 2013)
Form
PageView
MultiColumn ComboBox
TextBox
RichTextEditor
Menu
PropertyGrid
RichTextBox (obsolete as of Q3 2014 SP1)
Panelbar (obsolete as of Q2 2010)
Tabstrip (obsolete as of Q2 2010)
PivotGrid and PivotFieldList
MaskedEditBox
CommandBar
PdfViewer and PdfViewerNavigator
ListControl
Carousel
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
GanttView
New Product Suggestions
Toolstrip (obsolete as of Q3 2010)
AutoCompleteBox
Label
VirtualGrid
ContextMenu
Spreadsheet
Panel
Visual Studio Extensions
TitleBar
Documentation
SplitContainer
Map
DesktopAlert
ProgressBar
Rotator
TrackBar
MessageBox
CheckedDropDownList
SpinEditor
StatusStrip
CheckedListBox
Wizard
ShapedForm
SyntaxEditor
TextBoxControl
LayoutControl
CollapsiblePanel
Conversational UI, Chat
CAB Enabling Kit
TabbedForm
DataEntry
GroupBox
ScrollablePanel
WaitingBar
ImageEditor
ScrollBar
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
BindingNavigator
PopupEditor
RibbonForm
Styling
TaskBoard
Barcode
Callout
ColorBox
PictureBox
VirtualKeyboard
FilterView
Accessibility
DataLayout
NavigationView
ToastNotificationManager
CalculatorDropDown
Localization
TimePicker
ValidationProvider
FontDropDownList
Licensing
BreadCrumb
ButtonTextBox
LocalizationProvider
Dictionary
Overlay
Security
Separator
SparkLine
TreeMap
StepProgressBar
SplashScreen
ToolbarForm
NotifyIcon
Rating
TimeSpanPicker
BarcodeView
Calculator
OfficeNavigationBar
Flyout
TaskbarButton
HeatMap
SlideView
PipsPager
+? more
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?