Clear RadTimePicker

11 posts, 1 answers
  1. Mark
    Mark avatar
    67 posts
    Member since:
    Jan 2015

    Posted 28 Jun Link to this post

    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

  2. Answer
    Dimitar
    Admin
    Dimitar avatar
    1994 posts

    Posted 29 Jun Link to this post

    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.
  3. Mark
    Mark avatar
    67 posts
    Member since:
    Jan 2015

    Posted 29 Jun Link to this post

    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.
  4. Dimitar
    Admin
    Dimitar avatar
    1994 posts

    Posted 29 Jun Link to this post

    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.
  5. Mark
    Mark avatar
    67 posts
    Member since:
    Jan 2015

    Posted 29 Jun in reply to Dimitar Link to this post

    You used the RadDateTimePicker.  I am using the RadTimePicker.  
  6. Dimitar
    Admin
    Dimitar avatar
    1994 posts

    Posted 29 Jun Link to this post

    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.
  7. Mark
    Mark avatar
    67 posts
    Member since:
    Jan 2015

    Posted 29 Jun Link to this post

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

  8. Mark
    Mark avatar
    67 posts
    Member since:
    Jan 2015

    Posted 29 Jun Link to this post

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

  9. Mark
    Mark avatar
    67 posts
    Member since:
    Jan 2015

    Posted 30 Jun Link to this post

    didnt mean to post it twice

     

  10. Mark
    Mark avatar
    67 posts
    Member since:
    Jan 2015

    Posted 30 Jun Link to this post

    I found the problem, i was overwriting the value after in another method.. uggg.. thanks!
  11. Dimitar
    Admin
    Dimitar avatar
    1994 posts

    Posted 03 Jul Link to this post

    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.
Back to Top