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

Clear RadTimePicker

10 Answers 203 Views
Calendar, DateTimePicker, TimePicker and Clock
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 28 Jun 2017, 03:44 PM

We are using version 2016.3.1024.40 and i just want to clear the value.  I have tried setting the value = null and that does not work.  Standard controls that would work just fine.  There has to be a simple way to do this.  I have about 20 controls that I need to do this to.  Just want to take the value/text that is displayed and blank it out.

Thanks in advance.

Mark

10 Answers, 1 is accepted

Sort by
0
Accepted
Dimitar
Telerik team
answered on 29 Jun 2017, 08:01 AM
Hello Mark,

The following article shows how you can clear the value: Set null or empty value.

Should you have any other questions do not hesitate to ask.

Regards,
Dimitar
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Mark
Top achievements
Rank 1
answered on 29 Jun 2017, 11:31 AM
Yup tried that and NullableValue is not an option for the version i posted.  I have looked at ALL of Teleriks docs and they are no help.  I need some working code for my version.  Something simple would be preferred.
0
Dimitar
Telerik team
answered on 29 Jun 2017, 12:36 PM
Hi Mark,

This is working with your version. I have attached a small sample project that shows this.

Should you have any other questions do not hesitate to ask. 

Regards,
Dimitar
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Mark
Top achievements
Rank 1
answered on 29 Jun 2017, 12:41 PM
You used the RadDateTimePicker.  I am using the RadTimePicker.  
0
Dimitar
Telerik team
answered on 29 Jun 2017, 01:45 PM
Hi Mark,

This works with the time picker and the specified version as well (see attached video). 

Regards,
Dimitar
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Mark
Top achievements
Rank 1
answered on 29 Jun 2017, 01:57 PM

Designer:

 this.dtFirstStart = new Telerik.WinControls.UI.RadTimePicker();

 ((System.ComponentModel.ISupportInitialize)(this.dtFirstStart)).BeginInit();

// 
            // dtFirstStart
            // 
            this.dtFirstStart.Font = new System.Drawing.Font("Verdana", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.dtFirstStart.Location = new System.Drawing.Point(7, 41);
            this.dtFirstStart.MaxValue = new System.DateTime(9999, 12, 31, 23, 59, 59, 0);
            this.dtFirstStart.MinValue = new System.DateTime(((long)(0)));
            this.dtFirstStart.Name = "dtFirstStart";
            this.dtFirstStart.Size = new System.Drawing.Size(106, 21);
            this.dtFirstStart.TabIndex = 50;
            this.dtFirstStart.TabStop = false;
            this.dtFirstStart.Text = "radTimePicker1";
            this.dtFirstStart.ThemeName = "Office2010Blue";
            this.dtFirstStart.Value = null;

((Telerik.WinControls.UI.RadTimePickerElement)(this.dtFirstStart.GetChildAt(0))).ClickMode = Telerik.WinControls.ClickMode.Press;

//this does not work.  Does nothing

 private void btnClearThirdShift_Click(object sender, EventArgs e)
        {            
            dtFirstStart.Value = null;
        }

0
Mark
Top achievements
Rank 1
answered on 29 Jun 2017, 01:59 PM

Designer:

 this.dtFirstStart = new Telerik.WinControls.UI.RadTimePicker();

 ((System.ComponentModel.ISupportInitialize)(this.dtFirstStart)).BeginInit();

// 
            // dtFirstStart
            // 
            this.dtFirstStart.Font = new System.Drawing.Font("Verdana", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.dtFirstStart.Location = new System.Drawing.Point(7, 41);
            this.dtFirstStart.MaxValue = new System.DateTime(9999, 12, 31, 23, 59, 59, 0);
            this.dtFirstStart.MinValue = new System.DateTime(((long)(0)));
            this.dtFirstStart.Name = "dtFirstStart";
            this.dtFirstStart.Size = new System.Drawing.Size(106, 21);
            this.dtFirstStart.TabIndex = 50;
            this.dtFirstStart.TabStop = false;
            this.dtFirstStart.Text = "radTimePicker1";
            this.dtFirstStart.ThemeName = "Office2010Blue";
            this.dtFirstStart.Value = null;

((Telerik.WinControls.UI.RadTimePickerElement)(this.dtFirstStart.GetChildAt(0))).ClickMode = Telerik.WinControls.ClickMode.Press;

//this does not work.  Does nothing

 private void btnClearThirdShift_Click(object sender, EventArgs e)
        {            
            dtFirstStart.Value = null;
        }

0
Mark
Top achievements
Rank 1
answered on 30 Jun 2017, 01:35 PM

didnt mean to post it twice

 

0
Mark
Top achievements
Rank 1
answered on 30 Jun 2017, 03:02 PM
I found the problem, i was overwriting the value after in another method.. uggg.. thanks!
0
Dimitar
Telerik team
answered on 03 Jul 2017, 07:51 AM
Hi Mark,

I am glad that this is working fine now. Do not hesitate to contact us if you have other questions.

Regards,
Dimitar
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Calendar, DateTimePicker, TimePicker and Clock
Asked by
Mark
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Mark
Top achievements
Rank 1
Share this question
or