Josh
7 Answers, 1 is accepted
Thank you for writing.
The Autocomplete functionality is available witin the RadTextBox. This example shows how to access it, via a simple example. Please refer to the code-segment below:
TextBox tb = ((TextBox)((RadTextBoxItem)radTextBox1.RootElement.Children[0].Children[0]).HostedControl); | |
tb.AutoCompleteCustomSource.AddRange(new string[] { | |
"blabla", | |
"mlamla", | |
"clacla"}); | |
tb.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Append; | |
tb.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource; |
Thank you for directing our attention to this functionality. In the upcoming service pack, this functionality will be available at the top-level of the control. There will be no difference in the way you would use a Microsoft TextBox and a Telerik RadTextBox with respect to this functionality.
If you have any additional questions, let us know. We'd love to help you get acquainted with what our product has to offer.
All the best,
Kiril
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Ryan
Got it worked out....
Dim
tb As TextBox
tb =
DirectCast(DirectCast(tb_City.RootElement.Children(0).Children(0), RadTextBoxItem).HostedControl, TextBox)
Hi telerik,
How to filter radtextbox (autocomplete Mode) like "Contains mode"
Regards,
Jamsheer
Hello, jamsheer,
In order to activate "contains" autocomplete functionality in RadTextBox, you can set the AutoCompleteMode property to AutoCompleteMode.Suggest:
TextBox tb = ((TextBox)((RadTextBoxItem)radTextBox1.TextBoxElement.TextBoxItem).HostedControl);
tb.AutoCompleteCustomSource.AddRange(new string[] {
"blabla",
"mlamla",
"clacla"});
tb.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest;
tb.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource;
In addition, I would like to note that Telerik UI for Winforms suite offers RadTextBoxControl as well that supports auto complete functionality out of the box: https://docs.telerik.com/devtools/winforms/controls/editors/textboxcontrol/autocomplete
I hope this helps. Let me know if you have further questions.
Regards,
Nadya
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
Hi Nadya,
Thank u for u r Fast reply.
I done with your code with new radtextbox, But Its working startswith but contains is not working when filtering.
I attached a gif file of my work,
If working there pls give me a sample project
Thank you
jamsheer
Hello, jamsheer,
The default values of AutoCompleteMode that RadTextBox and RadTextBoxControl offers are: Append, Suggest, and SuggestAppend. When you choose Suggest option the auto-complete functionality searches for the exact match that starts with the typed character. According to your requirement, you need to search within the whole text for a word that contains a specified character.
In this case, I would recommend referring to the following KB article that demonstrates how you can create a custom RadTextBoxControl: https://docs.telerik.com/devtools/winforms/knowledge-base/textboxcontrol-autocomplete-contains. I believe this would fit your scenario.
I hope this helps. Should you have further questions please let me know.
Regards,
Nadya
Progress Telerik
Тhe web is about to get a bit better!
The Progress Hack-For-Good Challenge has started. Learn how to enter and make the web a worthier place: https://progress-worthyweb.devpost.com.