Hi Guys

i want a easy way of coding this,

when user selects any item from the datagrid(Yellow Color Arrow), i want to change the selected item in the combo accoring(Red color arrow) to datagrid selected value.
But combo has the ID and Name both

thanks
regards
sumith

Recommended Answers

All 3 Replies

Hi,

Try using some approach like ItemArray["LOCID"] and try to match it with the ComboBoxItem in your control.

   int i = 0;
                    foreach (object obj in cbolocation.Items)
                    {
                        if (obj.ToString().Substring(0, 4) == dgriproplist.CurrentRow.Cells[1].Value.ToString())
                        {
                            cbolocation.SelectedIndex = i;
                        }
                        i++;
                    }

Hi

managed to do like this ,done thanks for the idea

regards
sumith

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.