I am not very experienced with the WebCombo, yet. I am using NetAdvantage 2008 vol 1.
On page load, I am successfully setting the display of the WebCombo to a full name of a company by using FindByValue and the corresponding company 'code'. That is working fine.
After postback, though, I allow the user to edit values about the company and provide an update button. They may have selected a different company or left it the same. I am finding the SelectedIndex to be -1 after the postback and the DataValue is nothing. I wanted to resolve the company 'code' so I could send it down to the business layer to do the database update.
How can I get the WebCombo not to be affected by the postback?
It sounds like you are rebinding your data on the postback, which might clear out the value.
Okay...we're on the right track to isolating this. The initialize datasource event is not firing until after the postback. In the initialize datasource event for the web combo, I call a subroutine that sends the web combo down to a layer that retrieves the data from the database and binds it to the web combo. The web combo is getting populated but I never hit my breakpoint in the initialize datasource event. How can I force it to fire in the page load event?
InitializeDataSource is called when the control DataBinds. If the the control is "binding" you might be just seeing ViewState data. But then again, you are saying that the breakpoint isn't getting hit. If the only place you bind is in that subroutine, then it has to be going into it, break point or not. If other breakpoints are working on the page, then I would say that possible the event handler was disconneted, if no other break points are hit hten I would say that you are running without debugging or in release mode (which wouldn't break into code)