Re-Bind a Combo-box by other in same datagrid

Sara

New member
Joined
Feb 20, 2009
Messages
2
Programming Experience
1-3
I've got this question while i'm searching the web for my problem.It's the same as mine ..

I have a datagrid of three columns;

1. Comb-box1 : Employees' Names (DataSource : EmployeeBindingSource)
2. Comb-box2 : Coming Departure. (DataSource : DepartureBindingSource)
3. Text-box : ...............

* How can I filter or re-bind the source of the second one as the first one value changed (Both are in the same datagrid).
>> So as I select an Employee I need the second one gives me just the specific departures of the desired employee.Where I have the (Employee_No) field connect the two tables related to each one.

Your suggestions are highly appreciated.
 
You can't filter the source for the column because each cell will be different. You'll need to handle the EditingControlShowing event of the grid, test for a control showing in that column, get the value in the other column and then set the DataSource for the cell or the editing control directly.
 
Back
Top