hi,
i am using inheriting RadMaskedEditBox in a user control with Mask="D" for numeric only text boxes.
the strange behavior is that the textbox text becomes "0" when the control lost focus.
i traced it the problem arises from RadMaskComplexEditBehavior.UpdateUI() the change the RadMaskTextBox.ParentText to "0" and problem starts!
how can i solve this problem ?
thanks.
                                i am using inheriting RadMaskedEditBox in a user control with Mask="D" for numeric only text boxes.
the strange behavior is that the textbox text becomes "0" when the control lost focus.
i traced it the problem arises from RadMaskComplexEditBehavior.UpdateUI() the change the RadMaskTextBox.ParentText to "0" and problem starts!
how can i solve this problem ?
thanks.
7 Answers, 1 is accepted
0
                                
                                                    Richard Slade
                                                    
                                            
    Top achievements
    
            
                
                Rank 2
            
    
                                                
                                                answered on 16 Dec 2010, 12:20 PM
                                            
                                        Hello Eastern, 
Could you clarify a couple of points please.
In my case, a RadMaskedEditBox with the following settings:
has a default value of 0. This is what I would expect as it only accepts numeric input.
If I change this to (e.g.) 44 and tab away, then the text still reads 44.
Is this what happens for you too?
For reference I am using the latest 2010 Q3 SP1 version.
Richard
                                        Could you clarify a couple of points please.
In my case, a RadMaskedEditBox with the following settings:
Me.RadMaskedEditBox.Mask = "D"Me.RadMaskedEditBox.MaskType = MaskType.Numerichas a default value of 0. This is what I would expect as it only accepts numeric input.
If I change this to (e.g.) 44 and tab away, then the text still reads 44.
Is this what happens for you too?
For reference I am using the latest 2010 Q3 SP1 version.
Richard
0
                                
                                                    Eastern
                                                    
                                            
    Top achievements
    
            
                
                Rank 1
            
    
                                                
                                                answered on 16 Dec 2010, 01:50 PM
                                            
                                        hi richard,
a bit different, actually i set my desired number in the form_load into the textbox not entered by hand.
Form_Load:
maskedTextBox1.Text = "14"
                                        a bit different, actually i set my desired number in the form_load into the textbox not entered by hand.
Form_Load:
maskedTextBox1.Text = "14"
0
                                Accepted
                                                    Richard Slade
                                                    
                                            
    Top achievements
    
            
                
                Rank 2
            
    
                                                
                                                answered on 16 Dec 2010, 01:59 PM
                                            
                                        Hi Eastern, 
The reason that this happens (I think), is that the text property is taken from the value property. You have changed the text but not the value so when you tab away, the text is updated to match the value. Please try setting
instead of the text, and you should find all is ok.
Hope that helps, but let me know if you need more information
Richard
                                        The reason that this happens (I think), is that the text property is taken from the value property. You have changed the text but not the value so when you tab away, the text is updated to match the value. Please try setting
maskedTextBox1.Value = 14instead of the text, and you should find all is ok.
Hope that helps, but let me know if you need more information
Richard
0
                                
                                                    Eastern
                                                    
                                            
    Top achievements
    
            
                
                Rank 1
            
    
                                                
                                                answered on 16 Dec 2010, 02:36 PM
                                            
                                        actually, i have a new implementation of Value in my inherited user control , is it ok?
                                        0
                                Accepted
                                                    Richard Slade
                                                    
                                            
    Top achievements
    
            
                
                Rank 2
            
    
                                                
                                                answered on 16 Dec 2010, 02:53 PM
                                            
                                        I think it will be fine. Give it a go (using .value rather than .text) and let me know if that's ok
thanks
Richard
                                        thanks
Richard
0
                                
                                                    Eastern
                                                    
                                            
    Top achievements
    
            
                
                Rank 1
            
    
                                                
                                                answered on 16 Dec 2010, 03:00 PM
                                            
                                        i used this piece of code in my implementation of  Text and Value :
base.Value = value;
and everything works fine now ;)
i marked your helpful post as answer.
Thanks Richard.
                                        base.Value = value;
and everything works fine now ;)
i marked your helpful post as answer.
Thanks Richard.
0
                                
                                                    Richard Slade
                                                    
                                            
    Top achievements
    
            
                
                Rank 2
            
    
                                                
                                                answered on 16 Dec 2010, 03:01 PM
                                            
                                        Glad to have been able to help
All the best
Richard
                                        All the best
Richard