5 Answers, 1 is accepted
0
Hello Hans,
Thank you for contacting us.
By design RadDropDownList processes the autocomplete information on every KeyPress, however you can easily change this behavior with the following custom classes:
This will perform filtering operations one second after a user has typed something in the TextBox.
I hope this helps.
Regards,
George
Telerik
Thank you for contacting us.
By design RadDropDownList processes the autocomplete information on every KeyPress, however you can easily change this behavior with the following custom classes:
public
class
MyDropDownList : RadDropDownList
{
protected
override
RadDropDownListElement CreateDropDownListElement()
{
return
new
MyDropDownListElement();
}
}
public
class
MyDropDownListElement : RadDropDownListElement
{
private
KeyPressEventArgs args;
protected
override
AutoCompleteSuggestHelper CreateAutoCompleteSuggestHelper()
{
return
new
MyHelper(
this
, 1000);
}
}
public
class
MyHelper : AutoCompleteSuggestHelper
{
private
System.Windows.Forms.Timer timer;
private
string
filter;
private
bool
timePassed;
public
int
AutoCompleteInterval {
get
;
set
; }
public
MyHelper(RadDropDownListElement owner,
int
interval)
:
base
(owner)
{
this
.AutoCompleteInterval = interval;
this
.timer =
new
System.Windows.Forms.Timer { Interval = interval };
this
.timer.Tick += timer_Tick;
}
private
void
timer_Tick(
object
sender, EventArgs e)
{
this
.timePassed =
true
;
this
.HandleAutoSuggest(
this
.filter);
}
public
override
void
HandleAutoSuggest(
string
filter)
{
if
(
this
.timePassed)
{
base
.HandleAutoSuggest(filter);
}
this
.filter = filter;
this
.timer.Stop();
this
.timer.Start();
this
.timePassed =
false
;
}
}
This will perform filtering operations one second after a user has typed something in the TextBox.
I hope this helps.
Regards,
George
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Hans
Top achievements
Rank 1
answered on 28 Nov 2013, 02:54 PM
in the code I see 'private KeyPressEventArgs args' but I think you forgot the code that actually does something with the keypress, because the sample is not working
0
Hans
Top achievements
Rank 1
answered on 28 Nov 2013, 08:53 PM
After much googling I found the solution:
myDropDownList.DropDownStyle = RadDropDownStyle.DropDown;
myDropDownList.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
myDropDownList.DropDownListElement.AutoCompleteAppend.LimitToList = true;
myDropDownList.DropDownStyle = RadDropDownStyle.DropDown;
myDropDownList.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
myDropDownList.DropDownListElement.AutoCompleteAppend.LimitToList = true;
0
Hello Hans,
I am glad that you managed to resolve your problem.
Should you need any further assistance, do not hesitate to contact us.
Regards,
George
Telerik
I am glad that you managed to resolve your problem.
Should you need any further assistance, do not hesitate to contact us.
Regards,
George
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Mehry
Top achievements
Rank 1
answered on 17 Mar 2020, 04:04 PM
Thank you! it works for me.