Hi,
I have a web drop down ...
<ig:WebDropDown ID="wddUsers" runat="server" DropDownAnimationType="Bounce" DropDownContainerMaxHeight="85px"
EnableAutoFiltering="Client" EnableDropDownAsChild="False" EnableRenderingAnchors="False"
StyleSetName="Default" Width="175px" DropDownContainerHeight="85px">
<ClientEvents ValueChanged="wddUsers_ValueChanged" Focus="wdd_Focus" ValueChanging="wdd_ValueChanging" DropDownClosing="wddUsers_DropDownClosing" />
</ig:WebDropDown>
Hi ,
Yes this is possible. IT's kind of tricky, but i have created a solution for you. Please follow the following steps:
1) Set this client-side event for ValueChanged:
<ClientEvents ValueChanged="setCaretToStart" />
2) then define the following javascript in your page:
<script type="text/javascript">
function resetCaret() {
pos = 0;
ctrl = $find("WebDropDown1")._elements["Input"]; // change this to the server-side ID of your DropDown control
if (ctrl.setSelectionRange) { //FF, etc.
ctrl.focus();
ctrl.setSelectionRange(pos, pos);
}
else if (ctrl.createTextRange) { // IE
var range = ctrl.createTextRange();
range.collapse(true);
range.moveEnd('character', pos);
range.moveStart('character', pos);
range.select();
function setCaretToStart(sender, args) {
setTimeout("resetCaret()", 50);
</script>
And that should do it. The setTimeout workaround is necessary only for IE, because for some reason it doesn't directly update the caret, there needs to be some timeout in between.
Please let me know whether this works for you.
Thank you,
Angel
Angel,
Thank you! This solves my problem.