Datagrid: Linking combobox columns?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to use a datagrid for data entry. I've created a couple of combo
box columns using information from
http://64.78.52.104/FAQ/WinForms/FAQ_c44c.asp#q480q

That example basically sets every combobox in a given column (for every row)
to the same datasource.

One obstacle I have to overcome is when a user changes a value in one
column, the next combobox in the next column on the same row needs to bind to
a new set of data, and only for that row. For example, Column A is Cost
Centers, Column B is Job Codes. If I select a Cost Center from Column A, the
combo in Column B needs to list only valid Job Codes for the previously
selected Cost Center, on a row-by-row basis.

Any idea how to do this, or is there a sample somewhere someone could point
me to?

Thanks!
 
Woops, sorry, I'm in the WinForms datagrid. ASP.Net handles this type of
thing pretty well, but I have to figure out how to pull it off on WinForms.
Thanks, though.
 
In the Column A Combobox.SelectionChangeCommitted Event
You can reset Column B's combobox's datasource, or filter the job codes
for the selected Cost Center, assuming ComboBox B is bound to a
datatable or dataview.

David
 
Back
Top