7 Answers, 1 is accepted
Yesterday I posted a simple example demonstrating how to open RadComboBox when the user starts typing:
http://www.telerik.com/community/forums/silverlight/combobox/autocomplete-dropdown-list-error.aspx
It is for Silverlight, but the code should work in WPF without modifications.
Regards,
Valeri Hristov
the Telerik team
Thanks,
Akhil
You could create the binding in the code-behind. Something like this:
var comboBox = new RadComboBox();
... code to initialize the combobox ...
comboBox.SetBinding(IsDropDownOpenProperty, new Binding("Text")
{
Source = comboBox,
Converter = new TextToDropDownOpenConverter(),
Mode = BindingMode.TwoWay
});
Kind regards,
Valeri Hristov
the Telerik team
I used the code as you suggested now the problem are
1. I cannot close drop down combo box after select text.
2. I have two combo box in one screen both by default coming as as open combobox taht i don't want.
Please look the my code and let me know what I'm missing
RadComboBox cb = new RadComboBox();
bndi =
new Binding("CvlItems");
cb.SetBinding(
RadComboBox.ItemsSourceProperty, bndi);
bndv.ConverterParameter =
"ComboBox";
cb.SetBinding(
RadComboBox.SelectedItemProperty, bndv);
cb.SetBinding(
RadComboBox.IsEnabledProperty, bnde);
cb.SetBinding(
RadComboBox.HeightProperty, bndh);
cb.SetBinding(
RadComboBox.WidthProperty, bndw);
cb.DisplayMemberPath =
"DisplayValue";
cb.SetBinding(
RadComboBox.IsDropDownOpenProperty, new Binding("Text")
{
Source = cb,
Converter =
new TextToDropDownOpenConverter(),
Mode =
BindingMode.TwoWay
});
cb.TextSearchMode =
TextSearchMode.Contains;
cb.CanAutocompleteSelectItems =
true;
cb.CanKeyboardNavigationSelectItems =
true;
cb.IsFilteringEnabled =
true;
cb.OpenDropDownOnFocus =
true;
cb.IsEditable =
true;
return cb;
Please see the attached file also.
Thanks,
Akhil
You code looks fine. Could you please send us a running sample that reproduces the problem with these two RadComboBox controls. It will shed some light on the current issue and it would be very helpful to investigate the problem.
I will be glad to assist you further.
George
the Telerik team
I cannot create sample project, it's very complicated to make sample project.
I think the problem in "TextToDropDownOpenConverter"
(http://www.telerik.com/community/forums/silverlight/combobox/autocomplete-dropdown-list-error.aspx) class,
when you enter or type in combobox it's set RadComboBox.IsDropDownOpenProperty always true or select combobox value by mouse will set always true.
cb.SetBinding(RadComboBox.IsDropDownOpenProperty, new Binding("Text")
{
Source = cb,
Converter = new TextToDropDownOpenConverter(),
Mode = BindingMode.TwoWay
});
I tried also cb.StaysOpenOnEdit = true but no luck.
Any thoughts how to fix converter or any other idea?
Unfortunately, this implementation is not supported in WPF. Sorry for any inconvenience caused.
Please do not hesitate to contact us if you require any further information.
George
the Telerik team