Dear Telerik,
i would like to use a custom ajax extender to use with the numeric textbox. Sadly i get a similiar error to this one:
Extender control '' cannot extend 'myNumericTextbox1'. Extender controls of type 'CustomExtenders.MyCustomerExtender1' cannot extend controls of type 'Telerik.Web.UI.RadNumericTextBox'.
Am i doing something wrong or is this by design?
This because for numeric textboxes we want to allow 2 decimal seperators, both , and .
We have a solution, namely: see code.
Basicly we handle a '.' keypress differently. In that case we cancel the current keypress and simulate another one
which we call on the numerictextbox. Cause we set the property _numPadDecimalSeparatorPressed to true,
we can reuse the current event without problems :).
We would like to solve this in an extender, please advice.
i would like to use a custom ajax extender to use with the numeric textbox. Sadly i get a similiar error to this one:
Extender control '' cannot extend 'myNumericTextbox1'. Extender controls of type 'CustomExtenders.MyCustomerExtender1' cannot extend controls of type 'Telerik.Web.UI.RadNumericTextBox'.
Am i doing something wrong or is this by design?
This because for numeric textboxes we want to allow 2 decimal seperators, both , and .
We have a solution, namely: see code.
Basicly we handle a '.' keypress differently. In that case we cancel the current keypress and simulate another one
which we call on the numerictextbox. Cause we set the property _numPadDecimalSeparatorPressed to true,
we can reuse the current event without problems :).
We would like to solve this in an extender, please advice.
function
keypress(sender, args) {
var
char = args.get_keyCharacter();
//allow a dot to be a comma (only needed when we DONT press numpad decimalseperator)
if
(char ==
"."
&& !sender._numPadDecimalSeparatorPressed) {
//cancel current event
args.set_cancel(
true
);
//now fake a decimal seperator pressed keypress
sender._numPadDecimalSeparatorPressed =
true
;
//and send it back to the telerik handler
sender._onTextBoxKeyPressHandler(args._domEvent);
}
}