Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
355
place ultraComboEditor on a Panel
posted

Hi ,

I have a comboBox that has three options i.e TextBox , ComboxBox , UltraComboEditor ( with check boxes). Depending on what the user clicks , that control should be displayed ontop of a Panel in a Table Layout Panel. I am achieving this using if else and setting Visible property to true for one of them and false for the other two.

The text box and combobox get displayed when i choose the respective option but UltraComboEditor doesnt get displayed . Initiailly I keep all of their visibily to false . Then I go changing based on user selection.

My problem is that my UltraComboEditor never seems to be displayed. Heres some code :

private void Form1_Load(object sender, EventArgs e)
{

this.ultraComboEditor1.CheckedListSettings.CheckBoxStyle = Infragistics.Win.CheckStyle.CheckBox;
this.ultraComboEditor1.CheckedListSettings.CheckBoxAlignment = ContentAlignment.MiddleLeft;

}

private void comboBox3_SelectionChangeCommitted(object sender, EventArgs e)
{
ReplaceComponent((ComboBox) sender, comboBox8, textBox3,ultraComboEditor3);

}

private void ReplaceComponent(ComboBox sender,ComboBox c,TextBox t,UltraComboEditor u)
{
if (sender.SelectedItem.ToString() == "ComboBox")
{
c.Items.Clear();
c.Items.Add("");
c.Items.Add("ASA");

c.Visible = true;
t.Visible = false;
u.Visible = false;
}
else if (sender.SelectedItem.ToString() == "UltraComboEditor")
{
u.Items.Clear();
u.Items.Add("Black Oil");
u.Items.Add("Dry Gas");
u.Items.Add("Gas Cond");
u.Items.Add("Heavy Oil");
u.Items.Add("Volatile Oil");


u.Visible = true;


t.Visible = false;
receiver.Visible = false;
}
else if (sender.SelectedItem.ToString() == "TextBox")
{

u.Visible = false;


t.Visible = true;
receiver.Visible = false;

}

Only other way i can do this is by passing the panel and clearing all contorls and adding the one I want .

Parents
  • 23930
    Suggested Answer
    Offline posted

    Hi Prasaanth,

    Thank you for posting in our forums.

    I have created a small sample based on the provided code and I tested the described scenario. The UltraComboEditor (as any other control) is shown when its Visible property is set to true. Is the control added to the Controls collection of the form? What is the “receiver” control in your source code? Why aren’t you setting the Visible property of the ComboBox to false when you select the UltraComboEditor or the TextBox? The ComboBox may be hiding the UltraComboEditor.

    I have attached the sample I used to test it. Please modify it so that it reproduces your issue or provide me with your own. I will be glad to research this issue further after I have receive the modified sample.

    Thank you for your collaboration.

    I am looking forward to hearing from you.

    WCE_ComboNotVisible.zip
Reply Children