Thanks for your quick reply, Bob! Unfortunately I couldn't get that to work for me either. this.cboFee.selectedValue was always empty, and the selectedIndex was -1, even when I had selected a value. I completely unbound everything in design, and even switched it from an mmDropDown to a regular html 'select' but that field never had a value at save-time.
But I figured out a way to get it to work. I put a hidden mmTextBox on the form, bound that to the field I wanted, and then used a little jQuery javascript to copy the value from the combobox to the textbox at the right time. Seems a bit kludgy but it works perfectly. And it has the added benefit of allowing me to doublecheck which value was selected, if I unhide the textbox.
On to the next challenge!
Eric
>You don't have to use the Binding properties in MM in every situation. If it is called for you could do something like this in your click method of the Save button:
>
>
>DataSet dsTrade = (DataSet)Session["dsTrade"];
>if (this.cboAccount.SelectedValue.Length == 0)
>{
> this.cboAccount.SelectedValue = "0";
>}
>this.cboAccount.BindingType = mmBindingType.None;
>dsTrade.Tables[0].Rows[0]["AccountID"] = int.Parse(this.cboAccount.SelectedValue);
>
>
>The above code is referencing a combo box on my form (cboAccount) that I load using similar methods as you mention below, namely, as postbacks to the server based on user actions on other controls. Eventually, the user will need to select one of the values. The reason I set the selected value to '0' is so the business rule will throw back an error stating that this value must be entered. The underlying table (or business object) is Trade and the column is AccountID.
>
>HTH
>
>>Ok, we're coming along now. Here's my next roadblock:
>>
>>I've got a couple of comboboxes on my web form. When the user selects a value from the first one, I use some Ajax and a web service (using a page method - slick!) to populate the values in the second combobox. It seems to be halfway bound properly to the entity, because when I try to save the entity, it tells me that the value is a string, when it expected an Int32.
>>
>>So my question is, what should my binding settings be on a combobox that's populated manually?
>>
>>Thanks!
>>
>>Eric