Click here to Skip to main content
15,895,011 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i have 3 columns into a datagridview.
1=employeeid
2=empName
3=Instructions.

whenever focus enter into cell named employee name the combo should ready to give employee list. and whenever i select an employee; it gives me all the records of that selected employee which saved in master forms.

Combobox should have property like editable and auto complete.
Posted
Updated 9-Oct-14 21:53pm
v2
Comments
Sinisa Hajnal 10-Oct-14 4:53am    
What is your question? And what have you tried before asking here?
George Jonsson 10-Oct-14 5:22am    
I guess the question is "Can anyone write my code for free". :P

1 solution

As you have not really specified what your problem is, this answer can only guide you in the right direction.

For the first column, 'empName', you only need to select a data source for the ComboBoxColumn.
See DataGridViewComboBoxColumn Class[^]

From your description it looks like you want to filter the values shown in the second ComboBoxColumn, 'Instructions' depending on the selection in the 'empName' column.
You can achieve this in different ways.

One way is to query the database for new values every time a different 'empName' is selected and then update the DataSource of the ComboBoxColumn.

Another way is to read all instruction data into a DataTable, connect it to a DataView[^] or BindingSource[^] and then change the RowFilter/Filter every time a different 'empName' is selected.
 
Share this answer
 
Comments
Sinisa Hajnal 10-Oct-14 6:14am    
Good solution for badly formed question :) High 5!
George Jonsson 10-Oct-14 7:43am    
Thanks.
More of a nudge in the right direction, though.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900