I am using .net 2.0 windows forms. I have a combobox with following
properties.
DropDownStyle : DropDown
AutoCompleteMode : Suggest
AutoCompleteSource: Listitems
Now When I run the form and go to the combobox and type something it
works just fine. combobox suggest items as well.
If user does not select anything from combobox and hit submit button, I
am populating datagridview with all data.
Now when user select any item from combox and hit submit button i am
populating datagridview for that specific item.
The problem is user can type into the dropdown and dropdown suggests
the item as long as someone clicks submit button first time.
As soon I populate the datagrid first time, I can not type anything
into the combobox. I want user to type into the combobox and select
items at any time.
Its kinda strange. I would highly appreciate if someone can help me
here.
thanks

Combobox does not access key stroke
Dan H.
Amit,
Can you try this bit of code and see if it working IT works here-
Create a new form and add a combo to it.
using
System;using
System.Collections.Generic;using
System.ComponentModel;using
System.Data;using
System.Drawing;using
System.Text;using
System.Windows.Forms;namespace
WindowsApplication2{
public partial class Form1 : Form{
public Form1(){
InitializeComponent();
string[] names ={ "James", "Alan", "Jeff" };comboBox1.Items.AddRange(names);
}
}
}
Are you not able to type in anything always I feel that you may reseting the values in the combo OR any of the properties of the combo.
Send in a code snippet and we will try to figure out the issue.
Allivelu
Hi Karthik
Thanks for your reply. I think you did not understand my question properly or I think I could not put my problem in correct words.
I have a form. Which has a Datagrid and a combo box. I am binding them at run time.
Now when I bind them first time combobox works just fine. I can type in the combobox.
On datagrid right click user select some option and I bind the datagrid again with result. I do not bind Combobox at that time as combobox already have data.
Now at this point if I will go to combobox and try to type anything it wont work. I can see the values in the combobox when I drop down. I am binding values in form load and not clearing at any point.
You can try the same using the following combobox properties.
AutoCompleteMode = Suggest
AutoCompleteSource = ListItems
Soham
I would highly appreciate if someone could help me here. I need to answer this to client.