Hi
I have 5 combos on a form, and the first one is the filter for the others. I have already written the event handlers that are activated when the user selects an item on the first combo, and my question is, how can I hook into the same events when the form opens and the first combo is bound? The SelectedValueChanged event isn't fired when databinding to the SelectedValue.
Any help would greatly appreciated.
thanks
Ozi
Hi David
Thanks for the suggestion. I'm trying to fit this into the MVC I've got going here. The SelectedIndexChanged event works fine when an item is selected, so I was hoping to trigger the same events when the data is bound on the filter combobox so that I could use the same event handler for both. But for some reason the databinding doesn't always trigger the event.
Ozi
I try not to put business logic in event handlers if I can help it.
I prefer to have the event handler call another method that actually does the work. That way, I can have the same logic invoked by multiple handlers with a minimum of bother.
I understand what you are saying, and I agree.
This is what happens, when a user selects an item from the filter combo:
SelectedIndexChanged event is fired (UI) and the handler (controller) retrieves the data and returns the objects back to the UI via an (controller) event.
So I thought, since I had this nice pattern working, I could hook into it in when the form load and the data is loaded and bound, and get the initializition using the same logic as the combo SelectedIndexChanged event.
I'm trying to steer clear of calling the controller directly.
Copyright (c) Marimer LLC