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

Possible Bug? MaskedTextbox and AutoComplete

9 Answers 196 Views
AutoCompleteBox
This is a migrated thread and some comments may be shown as answers.
Jason Parrish
Top achievements
Rank 1
Jason Parrish asked on 19 Nov 2010, 11:57 PM
I have a masktextbox set to a numeric mask.  I also have an AutoCompleteSource with a list of numbers set to Append.  If the value appended is the desired value and the user tabs or clicks out of the box, the appended value is not kept and only the value typed in is shown.

Example when AutoCompleteSource values are  111890, 57869, 42356:
  • User enters  "11".  
  • Textbox value is appended to show "111890".
  • User tabs out of textbox.
  • Textbox value now displays "11".

Desired scenario:
  • User enters  "11".  
  • Textbox value is appended to show "111890".
  • User tabs out of textbox.
  • Textbox value now displays "111890".

If the mask type is set to none, the desired scenario is met.

Please advise.  Is there simply a property I have set incorrectly?  Is this a bug?  Or is not supported/implemented?



9 Answers, 1 is accepted

Sort by
0
Richard Slade
Top achievements
Rank 2
answered on 20 Nov 2010, 12:56 PM
Hello Jason,

May I ask what version of the controls you are using? I have tested this under the latest version and I am unable to replicate it.

Here is how I have it set up
Me.RadMaskedEditBox1.AutoCompleteCustomSource.Clear()
Me.RadMaskedEditBox1.MaskType = MaskType.Numeric
Me.RadMaskedEditBox1.AutoCompleteCustomSource.Add("111890")
Me.RadMaskedEditBox1.AutoCompleteCustomSource.Add("57869")
Me.RadMaskedEditBox1.AutoCompleteCustomSource.Add("42356")
Me.RadMaskedEditBox1.AutoCompleteSource = AutoCompleteSource.CustomSource
Me.RadMaskedEditBox1.AutoCompleteMode = AutoCompleteMode.Append

and after entering 11, it appends the remaining ..1890 and when I tab away, it is left as 111890 which is correct.

hope this helps
richard
0
Richard Slade
Top achievements
Rank 2
answered on 22 Nov 2010, 02:33 PM
Hello,

How did you get on with this? If it helped, please remember to mark as answer. If you need more assistance, please just let me know. ]
thanks
Richard
0
Jason Parrish
Top achievements
Rank 1
answered on 22 Nov 2010, 03:10 PM
I had the same settings, except I also had:

Me.RadMaskedEditBox1.Mask = "#"

If I removed the mask being set to "#", the tabbing/clicking works as expected.  However, the "value" property returns the previous value, even if I type the full value.  The "text" property does return the correct value.  

If I keep the mask set to "#", the value and text property are both set correctly.  However, then the tabbing/clicking stops working as expected.
0
Richard Slade
Top achievements
Rank 2
answered on 22 Nov 2010, 03:50 PM
Hello,

the # mask is as far as I'm aware for use with a mask type of Standard. Have a look at this link.

To have this working I would advise
Me.RadMaskedEditBox1.AutoCompleteCustomSource.Clear() 
Me.RadMaskedEditBox1.MaskType = MaskType.Numeric 
Me.RadMaskedEditBox1.AutoCompleteCustomSource.Add("111890"
Me.RadMaskedEditBox1.AutoCompleteCustomSource.Add("57869"
Me.RadMaskedEditBox1.AutoCompleteCustomSource.Add("42356"
Me.RadMaskedEditBox1.AutoCompleteSource = AutoCompleteSource.CustomSource 
Me.RadMaskedEditBox1.AutoCompleteMode = AutoCompleteMode.Append

and getting the required value by
Private Sub RadMaskedEditBox1_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadMaskedEditBox1.Leave
    MessageBox.Show(Me.RadMaskedEditBox1.Text)
End Sub

hope that helps, but let me know if you have any other questions
Richard
0
Jason Parrish
Top achievements
Rank 1
answered on 22 Nov 2010, 04:09 PM
The "#" mask just for Standard makes sense.  However, the value property should be updated.  According to the documentation, "This property returns user input without the formatting characters.  If you want the input and the formatting characters, use the Textproperty. "

In the meantime, I have removed the "#" mask value and changed my code to use "text" property.
0
Richard Slade
Top achievements
Rank 2
answered on 22 Nov 2010, 04:12 PM
Hello,

I agree that the value property should be updated and it's confusing that it isn't. I'm glad this has solved your issue though. If you found that this has helped, please mark as answer so others can find the solution too.

Best regards,
Richard
0
Stefan
Telerik team
answered on 24 Nov 2010, 04:22 PM
Hello guys,

Thank you for writing.

As per the documentation: "Value: This property returns user input without the formatting characters. If you want the input and the formatting characters, use the Text property."

This means that when you have a mask for currency (i.e. "C") and you type 5 in the MaskedEditBox control, the value property will return "5" while the Text property will return "$5".

However, the "#" mask that you have set should allow only one digit (or space) in the mask editor. Since  this is not the case, this means that we have an issue in this scenario. I have logged the issue in our PITS and we will address it in a future release.

For the time being, as you already found out, you can remove the mask and stay with a Numeric MaskType.

@Jason Parrish. Thank you for reporting this case. It helped us to discover the issue. Your Telerik points have been updated.

@Richard. Thank you for the community effort, you points have also been updated.

Should you guys have any other questions, do not hesitate to write back.

Sincerely yours,

Stefan
the Telerik team

 

Get started with RadControls for WinForms with numerous videos and detailed documentation.
0
Swarup
Top achievements
Rank 1
answered on 20 Nov 2018, 02:26 PM

Hi Kendo Team, 

I have the same situation using in Kendo UI Masked control with AutoComplete. If I masked the auto complete control, it does not filter desire result from the autocomplete data list. Is this a bug in kendo that Maked control can not work with Autocomplete ?? Here is my code, please  provide solution if possible - 

 <div class="demo-section k-content">
        <h4><label for="Phones">Choose phone#:</label></h4>
     </div>

 <script>
        $(document).ready(function () {
            var data = [
                "7001",
                "7001.34.32",
                "7001.34.32.22",
                "7001.34.3",
                "7031.34.32"

            ];

            //create AutoComplete UI component
            $("#phones").kendoAutoComplete({
                dataSource: data,
                filter: "contains",
                placeholder: "Select Phone#..."
            });
     
            $("#phones").kendoMaskedTextBox({
                mask: "0000.00.00.00"
            });

});

    </script>

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 20 Nov 2018, 02:38 PM
Hi, Swarup,

I would like to note that this forum is related to the Telerik Ui for WinForms suite. However, it seems that your question is related to Kendo UI. That is why I would kindly ask you to post your technical questions in the relevant forum: https://www.telerik.com/forums

Thus, the appropriate support engineers and forum community will gladly assist you. Thank you for your understanding

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
AutoCompleteBox
Asked by
Jason Parrish
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Jason Parrish
Top achievements
Rank 1
Stefan
Telerik team
Swarup
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or