I need to know where the caret is in a RadTextBox while an action is occurring in RadComboBox. For example, somebody selects an item in the combobox, an item's value is to be inserted into the text in the RadTextBox at the position of the caret. As I try to determine the location of the caret by calling "get_caretPosition" on the RadTextBoxm I always get the same value -7341.
This is an incomplete function but enough to determine that I'm not getting the value I expected:
function CannedNoteSelected(sender, eventArgs) {
var selectedValue = eventArgs.get_item().get_value();
var pos = $find('<%= NoteToClientTxt.ClientID %>').get_caretPosition();
... do stuff here to insert merge new text into existing text but pos always contains -7310 no matter where the caret really is ...
$find('<%= NoteToClientTxt.ClientID %>').set_value(selectedValue);
}
This is an incomplete function but enough to determine that I'm not getting the value I expected:
function CannedNoteSelected(sender, eventArgs) {
var selectedValue = eventArgs.get_item().get_value();
var pos = $find('<%= NoteToClientTxt.ClientID %>').get_caretPosition();
... do stuff here to insert merge new text into existing text but pos always contains -7310 no matter where the caret really is ...
$find('<%= NoteToClientTxt.ClientID %>').set_value(selectedValue);
}
What am I doing wrong?