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

[Solved] autopostback and itemsrequested

2 Answers 289 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Gompje
Top achievements
Rank 1
Gompje asked on 21 Feb 2008, 10:55 AM
I'm in the process of upgrading some controls that use 2007 Q3 to prometheus. As far as I know they worked perfectly with the Q3 but I'm having some strange issues with prometheus.

objective: a combobox which allows you to find stuff on a web 2.0 way: typ something in it > items get requested. use the dropdown button > first x items get requested.

So I have this defined in code
        _eLocation.MyDropDownList.MarkFirstMatch = True 
        _eLocation.AutoPostBack = True 
        _eLocation.MyDropDownList.AllowCustomText = True 
        _eLocation.MyDropDownList.ShowMoreResultsBox = True 
        _eLocation.MyDropDownList.ItemRequestTimeout = 500 
        _eLocation.MyDropDownList.EnableLoadOnDemand = True 
 
        AddHandler _eLocation.SelectedIndexChanged, AddressOf NewLocationSelected 
        AddHandler _eLocation.ItemsRequested, AddressOf ItemsRequested 
        AddHandler _eLocation.TextChanged, AddressOf TextChanged 

_elocation is a servercontrol which contains a dropdownlist.
the events are mapped to a custom function.

Now the problem:
1. First load of the page:
 -  click on the button = dropdown opens but no items request, no trace of any event, no postback
 -  click on  the  v  below  =   items get requested - postback
2. second load (after the previous postback)
- click on the button=postback, items get requested - works as expected

I think that a click on the button used to cause a "itemsrequested" event.
Is their a way to achieve this with prometheus - without javascript ? It's nice that this is optional so we can now use the combobox as an autosuggestion textbox  :)

tx in advance

2 Answers, 1 is accepted

Sort by
0
Gompje
Top achievements
Rank 1
answered on 21 Feb 2008, 01:28 PM
update:

I've traced the problem further and when I don't set an "empty item text" the combobox works as expected.

This text is set like this:
Me.MyDropDownList.Text = "--- typ a name or select 1 from the list ---"

on the itemsrequested this text was cleared so on a request you got all the items.

This worked in Q3 2007 but breaks in prometheus, no postback...

Am I missing something?
0
Rosi
Telerik team
answered on 26 Feb 2008, 06:48 AM
Hi Gompje,

I suggest you that hook on the OnClientOpening event of RadComboBox and send request to its event handler:

As for an example:
function HandleOpen(sender, args) 
    sender.requestItems("",false); 
 

This will load items when the drop down is opened.

Hope this helps.

Kind regards,
Rosi
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
ComboBox
Asked by
Gompje
Top achievements
Rank 1
Answers by
Gompje
Top achievements
Rank 1
Rosi
Telerik team
Share this question
or