Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
455
Combo value not saving when setting the selected row
posted

I have a combo box filled with data the user clicks a button and a form is displayed that allows them to select a record that exists in the combo by looking at a lot more data to make there selection. I pass back the ID which is set to the ValueMeber of the combo. On the return I loop through the combo rows until I find the matching ID and I then set the selected row to the row object. All this works fine. My problem is that when I try to save my data the ValueMember isn't being saved.

I'm using VS2005 and I have the combo bound to a binding source, and all this is set correctly because if I make the selection by either keying in the value or selecting it in the dropdown everything works as it should. The only problem I am having is figuring out why the value isn't saving when I set the selected row in code.

Here is how I am setting the selected row.

foreach (Infragistics.Win.UltraWinGrid.UltraGridRow comboRow in icboContact.Rows){if ((Int32)comboRow.Cells["contact_id"].Value == someID){

icboContact.SelectedRow = comboRow;

break;}}

I don't understand why this isn't working. I know this has to be something with the combo not firing an edit event or something of that nature since I'm setting this in code, because if I make a selection in the combo in the normal way then the valueMember is saved correctly.

What am I missing? Thanks for any help.

Kris