We've got a drop down list inside a pop-up template from a grid. This drop down list is being populated correctly and you can select a value from the list and the value will be sent to the controller correctly. However when the data is loaded no value is selected initially so we are calling the select(0) function to automatically select the first item in the list. But when we do this the id value is not passed to the controller if the user doesn't select another item from the list.
Below is the DropDownList control. We are using the DataBound event to set the default value.
Below is the DataBound() event code. We are simply selecting the first item in the list.
The above code works visually but if we do not select another item in the drop down list the ParentId value of the object passed to the controller is 0. If we select another item in the list the ParentId value passed to the controller is correct.
Does anyone know why the select() call is not fully selecting the drop down list item but only appears to?