Question

It's probably doable, but with my n00b skills I couldn't figure this out yet.

When I try to "Make Into Part" on the RadMaskedTextBox, Expression Blend complains that it's not a TextBox.

How can I make it to use it as a proper control part? Can I "typecast" somehow in XAML?

Thanks in advance for all help!

Was it helpful?

Solution

The first answer is correct. While you can insert a RadMaskedTextBox into an autocomplete template (steps below), internally it wants to see a TextBox class to hook up the text changed event. The Telerik RadMaskedTextBox derives from Control instead, so the event is not hooked up.

  • Drag an AutocompleteBox onto your page.
  • Drag a Terlerik RadMaskedTextBox onto your page (to add the correct XML namespace for you)
  • Edit the AutoComplete template in Blend to generate a local template.
  • Manually edit the XAML template to use a RadMaskedTextBox instead of the TextBox.
  • Remove the Terlerik RadMaskedTextBox

The solution would be to use another Masked edit box that does derive from TextBox and insert it using the above steps

OTHER TIPS

You can't use the RadMaskedTextBox because it doesn't derive from TextBox. The code inside AutoCompleteBox specifies that this part must at least derive from TextBox.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top