Watch Pre-recorded Live Shows Here
Why Join
Become a member
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
C# Corner Home
Technologies
Monthly Leaders
ASK A QUESTION
Forum guidelines
harry code
2k
124
16.8k
KeyPress event in ComboBox
May 11 2018 4:02 AM
Hi,
I am working on Combobox.
I need to search by typing the character in the combobox by using linq.
I am using a gridview to display the data fro a table.
i have written the following code under ComboBox_KeyPres event
{
string combotext = comboBox1.Text;
dataGridView1.DataSource = from em in dc.emps where em.dept.Contains(combotext ) select em;
}
once i enter the character like 'A','D' etc the value is not getting stored in the variable Combotext.
after the keypress event is completed the value is getting stored into the variable.
I want the value to stored immediately after entering it into the Combobox.
Thank you
Reply
Answers (
2
)
Object reference not set to an instance of an object.
website open in different way in different browser