StrataFrame Forum

Custom ComboBox component.

http://forum.strataframe.net/Topic13834.aspx

By George Nentidis - 1/29/2008

Hi again.

I just need an opinion to help me make some decisions of a custom control I need to make.

I need to inherit from MicroFour.StrataFrame.UI.Windows.Forms.DevEx.ComboBoxEdit, so that I can add a second button next to the drop-down button.

The left button drops the list (just changed the icon) and the right one is going to display a simple form with a grid to edit the contents of the list. The contents of the list is always a BO that is defined using the PopulationDataSourceSettings.

The thing is that in editing the contents of the list, I will actually need the BO that populates the list. Is this by anyway accessible from the ComboBoxEdit, as protected property, or method that I can use?

If not, what do you think would be the best approach of doing this? I was thinking of using the BusinessObjectType property of the PopulationDataSourceSettings to create another BO instance, use reflection to call the MethodToExecute property of PopulateionDataSourceSettings, then edit the BO and ask the control to repopulate for beeing aware of the changes.  Of course it would be much easier if the population BO of the ComboBoxEdit was available.

Do you think this might work? Are there any other ideas? Has anybody else ever done this?

Thank you for your time

By StrataFrame Team - 1/30/2008

The business object that is used to populate the combo is not saved off... it loses scope and is cleaned up.  So, your best bet is to do exactly like you mentioned... create a new instance of the BO and populate it.  FYI, you might want to look at the source within the ListControl.vb file of the MicroFour StrataFrame UI assembly to get an idea on how we did it... maybe event copy over the code...
By George Nentidis - 1/31/2008

Thanks Ben, I 'll try that.