StrataFrame Forum

Browse Dialog Combo Question

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

By Marcia G Akins - 11/7/2011

Hi All.

Is it possible to have a "dependent" combo as a search criterion in the Browse Dialog so that it gets requeried after another combo is populated? If so, how?

TIA.

Marcia
By Edhy Rijo - 11/7/2011

Hi Marcia,

Sure that can be done nicely.  Just handle the BD ComboListPopulating and you will be done.  Here is a sample code from one of my projects:

Private Sub ActivateCardsBrowseDialog_ComboListPopulating(ByVal FieldName As StringByVal e As MicroFour.StrataFrame.UI.ListPopulatingEventArgsHandles MyBase.ComboListPopulating
             '-- Populate the Printer & Carrier data based on their VendorType
             Select Case FieldName
                 Case bizTransaction.bizTransactionFieldNames.FK_Vendor_Printer.ToString
                     '-- Pass the PrimaryBO EditingState to filter out Active records if needed.
                     e.Parameters(0).Value = MicroFour.StrataFrame.Business.BusinessEditingState.Idle
                     e.Parameters(1).Value = Business.bizVendor.bizVendorFieldNames.IsInactive.ToString
                     e.Parameters(2).Value = Business.Enumerations.VendorType.Printer

                 Case bizTransaction.bizTransactionFieldNames.FK_Vendor_Carrier.ToString
                     '-- Pass the PrimaryBO EditingState to filter out Active records if needed.
                     e.Parameters(0).Value = MicroFour.StrataFrame.Business.BusinessEditingState.Idle
                     e.Parameters(1).Value = Business.bizVendor.bizVendorFieldNames.IsInactive.ToString
                     e.Parameters(2).Value = Business.Enumerations.VendorType.Carrier
             End Select
         End Sub


Of course you need to setup your combobox population accordingly as you would normally do in a regular form.
By Marcia G Akins - 11/7/2011

Edhy Rijo (11/7/2011)
Sure that can be done nicely.  Just handle the BD ComboListPopulating and you will be done.  Here is a sample code from one of my projects:


Hi Edhy.

Boy you are quick Smile! Thanks so much!

Marcia
By Marcia G Akins - 11/7/2011

Hi Edhy.

I hate to be a pain, but I am almost there. This is what I have:

I have a "plants" combo as the first search criterion.

I have a departments combo as the second search criterion.

When the user pick a plant as a search criterion, I want only the departments for that plant displayed as the in the departments combo.

Can I do that?

Thanks!

Marcia
By Marcia G Akins - 11/7/2011

Hi Edhy.

Thanks for pointing me in the right direction. This works:

private void brwProjects_SearchValueChanged(object sender, MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialogSearchValueChangedEventArgs e)

{

if (e.SourceSearchField.FieldName.Equals("plant", StringComparison.OrdinalIgnoreCase) &&

((
ComboBox)e.SourceControl).SelectedIndex > 0)

{

e.AllVisibleSearchControls[
"dept"].Enabled = true;

object[] oParms = new object[1];

oParms[0] = ((
ComboBox)e.SourceControl).SelectedValue.ToString().Trim();

((MicroFour.StrataFrame.UI.Windows.Forms.
ComboBox)e.AllVisibleSearchControls["dept"]).Requery(oParms);

}

}

By Edhy Rijo - 11/7/2011

Hi Marcia,

Glad you figured out, I was looking at a sample I did in one of my applications, but found out you got it. Smile
By Marcia G Akins - 11/7/2011

Edhy Rijo (11/7/2011)
Glad you figured out, I was looking at a sample I did in one of my applications, but found out you got it. Smile


Hi Edhy.

I really appreciate your willingness to help and your quick response time. I try to give back by posting solutions to questions that I have posted (when I find them Smile) so that I can give back a little JIC someone else encounters something similar. I know that I always do a search to see if a solution has already been found before I post a question.

Have a great day!