TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Bang Lam
NA
1
1.1k
Autocomplete any character using textbox in C#
Apr 2 2014 10:46 PM
Hi all,
I have a datatable that include the data output as following:
{Apple, April, Orange, Lemon}
Currently, I'm using autocomplete method as below:
AutoCompleteStringCollection source = new AutoCompleteStringCollection();
DataTable dt = DataServiceMySQL.SearchCommandTextDataTable("SELECT `name` FROM `product`");
for (int i = 0; i < dt.Rows.Count; i++)
{
source.Add(dt.Rows[i][0].ToString());
}
txtProduct.AutoCompleteMode = AutoCompleteMode.Suggest;
txtProduct.AutoCompleteSource = AutoCompleteSource.CustomSource;
txtProduct.AutoCompleteCustomSource = source;
But this method
when you use
the filter method, data output such as the following example:
Ex: when you input character 'a' then the data output: Apple and April.
when you input chacter '
o
' then the data output:
O
range.
when you input chacter '
l
' then the data output:
L
emon.
But I want to inout character '
e
' then the data output: Appl
e
, Orang
e
.
Please help and thank you very much ^_^
Reply
Answers (
1
)
Object Reference Not Set To An Instance Object in Gridview
Regular Expression for a string