-1

Im using the code from from this link

and my Wix Dialogs looks like this

   <Control Id="DummyComboBox" Hidden="yes" Type="ComboBox" Sorted="yes" ComboList="yes" Property="DUMMYPROPERTY" X="65" Y="60" Width="150" Height="18">
      <ComboBox Property="DUMMYPROPERTY">
        <ListItem Text="Dummy" Value="Dummy"/>
      </ComboBox>
    </Control>
    <Control Id="SQLServer" Type="ComboBox" Sorted="yes" ComboList="yes"  X="150" Y="100" Width="110" Height="18" Property="DBSERVER"/>
    <Control Id="SQLServerLabel"  Type="Text" X="25" Y="100" Width="90" Height="18" NoPrefix="yes" Text="!(loc.SQLServerLabel)"/>

    <Control Id="SQLDatabaseName" Type="Edit" X="150" Y="120" Width="110" Height="18" Property="SQLDBNAME"/>
    <Control Id="SQLDBServerLabel" Type="Text" X="25" Y="120" Width="90" Height="18" NoPrefix="yes" Text="!(loc.SQLDatabaseLabel)"/>

    <Control Id="SQLUser"         Type="Edit" X="150" Y="140" Width="110" Height="18" Property="SQLUSER"/>
    <Control Id="SQLUServerLabel" Type="Text" X="25" Y="140" Width="90" Height="18" NoPrefix="yes" Text="!(loc.SQLUserLabel)"/>

    <Control Id="SQLPassword"     Type="Edit" X="150" Y="160" Width="110" Height="18" Property="SQLPASSWORD" Password="yes"/>
    <Control Id="SQLPServerLabel" Type="Text" X="25" Y="160" Width="90" Height="18" NoPrefix="yes" Text="!(loc.SQLPasswordLabel)"/>

I have walked through the code and it's functioning properly. However when I display the Wix Dialog the combo box is empty. Any idea as to what I'm doing wrong

Community
  • 1
  • 1
Michael
  • 657
  • 1
  • 6
  • 6

2 Answers2

5

Quite simple ...

Hidden="yes"

Hidden="no"

You are hiding it.

Dan McClain
  • 11,780
  • 9
  • 47
  • 67
Gary Carr
  • 51
  • 2
1

You need to write custom actions to fill the combo boxes for e.g. for filling Server Instance combo box u may be write some thing like given below:-

public static ActionResult FillServerInstances(Session xiSession)
{         
    xiSession.Log("Begin CustomAction");

    xiSession.Log("Opening view");
    View lView = xiSession.Database.OpenView(
        "DELETE FROM ComboBox WHERE ComboBox.Property='DBSRVR'");
    lView.Execute();

    lView = xiSession.Database.OpenView("SELECT * FROM ComboBox");
    lView.Execute();

    int Index = 1;
    bool flag = false;
    try
    {
        foreach (DataRow dr in Microsoft.SqlServer.Management.Smo.SmoApplication
                                        .EnumAvailableSqlServers(false).Rows)
        {
            String InstanceName = dr["Name"].ToString();

            if (InstanceName.Equals(xiSession["ComputerName"]
                + @"\"
                + xiSession["SQLINSTANCENAME"],
                StringComparison.InvariantCultureIgnoreCase))
            { flag = true; }

            Record lRecord = xiSession.Database.CreateRecord(4);
            xiSession.Log("Setting record details");
            lRecord.SetString(1, "DBSRVR");
            lRecord.SetInteger(2, Index);
            lRecord.SetString(3, InstanceName);
            lRecord.SetString(4, InstanceName);

            xiSession.Log("Adding record");
            lView.Modify(ViewModifyMode.InsertTemporary, lRecord);

            ++Index;
        }
    }
    catch (Exception ex)
    {
        logException(xiSession, ex);              
    }
    if (flag)
    {
        xiSession["DBSRVR"] = xiSession["ComputerName"].ToString()
            + @"\" + xiSession["SQLINSTANCENAME"].ToString();
    }

    lView.Close();

    xiSession.Log("Closing view");
    lView.Close();
    return ActionResult.Success;       
}
Ronald Wildenberg
  • 31,634
  • 14
  • 90
  • 133