We help IT Professionals succeed at work.
Get Started

filling a datagrid with data and selecting correct item in datagrid combobox

nsfranklin asked
Last Modified: 2008-02-26

I have a datagrid that contains a number of columns. Two of these columns contain comboboxes. The second combobox content changes depending on the first combobox selection. Once the user selects and fills in the relevant data, it is saved to an SQL database.

I have two problems.

1. If the user selects the first combobox, the second combobox choices are shown, however if the user changes their mind and selects a different index from the first combobox, I cannot get the second combobox to clear and re-fill with the new choices, they get appended.

2. When I load the data back into the DataGrid for editing, I cannot get the first and second comboboxes to display the users selection as was saved in the database. The choices are there but they are not selected.

Watch Question
Most Valuable Expert 2012
Top Expert 2008
This problem has been solved!
Unlock 1 Answer and 17 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE