This is a migrated thread and some comments may be shown as answers.

[Solved] MarkFirstMatch + LoadOnDemand = last character

2 Answers 123 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Sabrina Lanzoni Gonçalves
Top achievements
Rank 1
Sabrina Lanzoni Gonçalves asked on 14 Sep 2009, 02:45 PM
Hello, all,
I'm using the latest release of ASP.NET Ajax controls, and I'm facing a rather strange situation on one RadComboBox.

Actually I have a project where a particular combo box need to be loaded with one item (the default item: just setting RadCombo1.Text="something"; is not enough, for me). When an user opens it, this default value needs to be highlighted, because user has to be able of typing something into it. It has, amongst others, the following properties...

  • EnableLoadOnDemand="true"
  • MarkFirstMatch="true"
  • EnableTextSelection="true"
  • AllowCustomText="true"
... and the following client events:
  • OnClientDropDownOpening="OnClientDropDownOpening"
  • OnClientDropDownOpened="OnClientDropDownOpened"
  • OnClientDropDownClosed="OnClientDropDownClosed"
  • OnClientItemsRequesting="OnClientItemsRequesting"
  • OnClientFocus="OnClientFocus"
  • OnClientItemsRequested="OnClientItemsRequested"

Well, when I load it for the first time, "OnClientItemsRequested" fires twice; plus, and here's the strange behavior, at the first time the default value is correctly highlighted (this combo box is correctly filled with all values), but at the second time the cursor goes to the end of text. If I close it and re-open it, default value is correctly highlighted.

I already tried to set this combo box text with the item text and then selecting it on "OnClientDropDownOpened", with no success. I tried also to mimic "MarkFirstMatch" as explained here:

http://www.telerik.com/community/forums/aspnet/combobox/radcombobox-loadondemand-itemsrequested-firing-multiple-times.aspx

but, since I also need to highlight the text (so, EnableTextSelection="true"), I'd need to at least set an automatic postback on this control, what it's not ok for me, due to performance reasons.





Any hint?
Thank you!

Ciao,
Sabrina.

2 Answers, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 15 Sep 2009, 04:34 PM
Hello Sabrina Lanzoni Gonçalves,

I was unable to reproduce what are describing with a simple ComboBox loading Items from a Web Service.

Can you have a look at the attached project and let me know if I have missed something?

Best wishes,
Simon
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Sabrina Lanzoni Gonçalves
Top achievements
Rank 1
answered on 16 Sep 2009, 10:16 AM
Hi, Simon,
unfortunately your project is not suiting my needs. I changed it to reproduce the error and I'm opening a support ticket.

Thank you,
Sabrina.
Tags
ComboBox
Asked by
Sabrina Lanzoni Gonçalves
Top achievements
Rank 1
Answers by
Simon
Telerik team
Sabrina Lanzoni Gonçalves
Top achievements
Rank 1
Share this question
or