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

Back date and Future date is not working in radMaskedEditTextbox

3 Answers 24 Views
MaskedEditBox
This is a migrated thread and some comments may be shown as answers.
Ulagarajan
Top achievements
Rank 1
Ulagarajan asked on 14 Sep 2011, 09:57 AM
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

3 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 19 Sep 2011, 12:03 PM
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 >>

0
Ulagarajan
Top achievements
Rank 1
answered on 23 Sep 2011, 04:35 AM
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
0
Peter
Telerik team
answered on 28 Sep 2011, 09:40 AM
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 >>

Tags
MaskedEditBox
Asked by
Ulagarajan
Top achievements
Rank 1
Answers by
Peter
Telerik team
Ulagarajan
Top achievements
Rank 1
Share this question
or