In wdd text after get selected shows rather end of the text string. String is longer then the bos, how to make it display string from the beginning, i.e.
in the attached example the string 'Exhibit LR5: U.S. Foreign Tax Credit Data' shows as: 'oreign Tax Credit Data' and I would like to have it as 'Exhibit LR5: U.S. Foreig....' means showing text from the beginning.
Hello,
Thank you for posting in our forum.
Generally the Drop down will set the cursor position at the end of the string. You could set the it to the beginning if you’d like. For example you could handle the web drop down’s focus client side event and set the caret position in the beginning. For example:
<script type="text/javascript">
function setCaretPosition(elemId, caretPos) {
var elem = document.getElementById(elemId);
if (elem != null) {
if (elem.createTextRange) {
var range = elem.createTextRange();
range.move(
'character', caretPos);
range.select();
}
else {
if (elem.selectionStart) {
elem.focus();
elem.setSelectionRange(caretPos, caretPos);
else
function WebDropDown1_Focus(sender, eventArgs) {
var input = eventArgs.get_browserEvent().target;
setCaretPosition(input.id, 0);
</script>
Let me know if this is what you’re trying to achieve.
Best Regards,
Maya Kirova
Developer Support Engineer II
Infragistics, Inc.
http://es.infragistics.com/support
Maya, I'm not sure how it would work on focus event... in other part of my pj this little problem was seems like resolved by setting StretchHeight property to true.. but it was wdd as grid editor provider and I do not see this property in stand alone wdd. Attached sample site, can you show how your code would work there. All I need id to see the text inside wdd start from the beginning after selection changed.
Hello mcseidel ,
In that case it might be better to hook the event on DropDownOpened and DropDownClosed. For example:
<ClientEvents DropDownOpened="WebDropDown1_Focus" DropDownClosed="WebDropDown1_Focus" />
var input = sender._elements["Input"];
Then when you open the drop down the focus will be at the beginning of the string. When you select a value it will close the drop down and the focus will againg be set in the beginning.
I’ve attached the modified sample for your reference.
Let me know if that would solve your issue.
Thanks, that works, btw what happened to the StretchHeight property that I see on wdd when it is used as editor provider. That property provide solution without any coding...
Hey Maya,
I m using infragisitcs control first time. I m trying to implement below scenario, which you have sample but still I have problem implementing it. Can you please help me out with this.
I had a web drop down with multiselection checkbox,, i want to cascade with another dropdown.. once i select the multiple values from the web dropdown, on dropdownclose event I want to load values in another dropdown... is there any way in dropdownclose event I can call selectedchangeevent call? I have selected chage event on server side becuase I have database call. Hope to see the answer.
Thanks.
That property carries degree of convenience... Thanks for your help.
That’s a property of the editor provider wrapper. It’s not a property of the WebDropDown so you cannot use it when the drop down is a stand-alone control.
By default it stretches the height so that it matches the cell the drop down will be nested in.
Let me know if you have any questions or concerns.