Back date and Future date is not working in radMaskedEditTextbox

4 posts, 0 answers
  1. Ulagarajan
    Ulagarajan avatar
    4 posts
    Member since:
    Aug 2011

    Posted 14 Sep 2011 Link to this post

    Hi Team,

    When doing some research on radmaskedittextbox(DateFormat)  i observed the following things.

    1.By default maskedittextbox is allowing user to select only date between 1st of current month and
    current date.

    2.it is not allowing back date and also future date.

    3.I am not able to clear the default date of radmaskedittextbox(DateFormat)  in runtime.

    but in my application i want to allow back date and also future date.please tell me how to achieve this.

    My Code snippet:
     private void rcStartDate_SelectionChanged(object sender, EventArgs e)
            {        
                rmebStartDate.Clear();
                rmebStartDate.Text = "";
                rmebEndDate.Value = "";
                
                rmebStartDate.Text = rcStartDate.SelectedDate.ToShortDateString().ToString();
                rcStartDate.Visible = false;
            }


    Thanks
    Ulaga
  2. Peter
    Admin
    Peter avatar
    1148 posts

    Posted 19 Sep 2011 Link to this post

    Hi Ulagarajan,

    Thank you for writing.

    The provided information is not enough for me to understand what your scenario is and what you are trying to achieve. Therefore, I would like to kindly ask you to describe your case in greater detail - what your goal is and what issues you are dealing with. Additionally, screenshots and a sample project would be much appreciated.

    Thank you for your understanding and cooperation. I am looking forward to your reply.

    Greetings,
    Peter
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. UI for WinForms is Visual Studio 2017 Ready
  4. Ulagarajan
    Ulagarajan avatar
    4 posts
    Member since:
    Aug 2011

    Posted 22 Sep 2011 Link to this post

    Hi Peter,

    Problem fixed:

    Ans for Ques 1 & 2:

    Actually the problem is when i just set the US-format to calendar in properties alone and then on calendar-selectionchanged, if i am assigning the selected date as radcalendar. ToString() without applying culture,if i am selecting >12th date,it is assigning current date.

    Suppose if i apply the culture to the calendar control programmatically then it is taking both back date and future date.Eg:- rmebEndDate.Text = rcEndDate.SelectedDate.ToString("M", dfi);  

    Ans for Ques3:

    for clearing maskedittextbox i have to give both properties.

     rmebStartDate.Clear();
     rmebStartDate.NullText = "";


    Please suggest me whether my way of doing is correct or is that any alternative way.


    Thanks
    Ulaga
  5. Peter
    Admin
    Peter avatar
    1148 posts

    Posted 28 Sep 2011 Link to this post

    Hi Ulagarajan,

    Thank you for the provided details.

    You should use the Value property instead of Text property, so this line of code:
    rmebEndDate.Text = rcEndDate.SelectedDate.ToString("M", dfi);  

    should be changed to this:
    rmebEndDate.Value= rcEndDate.SelectedDate;

    If this does not help, I will kindly ask you to provide me with a sample project and detailed information on what you are trying to achieve. Please note that have to open a new support ticket in order to be able to attach your project.

    In case that you want to clear the text from RadMaskedEditBox, you should set Null to NullableValue
    this.radDateTimePicker1.NullableValue = null;

    We updated DateTime Picker's Text when the control loses focus. This allows the end-users to start entering Null Date and since the date remains visible, they can edit the date to the date they actually want.

    Thank you for your understanding and cooperation.

    Kind regards,
    Peter
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top