How to reset the MultiColumnComboBox Control?

Hi,


I'm currently writing a function that takes a Multicolumn combobox control as a parameter and its supposed to reset the contents of the mentioned control However after trying each and every possible solution I still don't have any progress


It ONLY works if I am currently focused ​on the combobox otherwise the function will only recognize it's existence but won't perform any operations.

Here is all the relevant code

This is where the function is called

ResetControls.cs

public static void ResetControls(Control Container)

{

foreach (Control control in Container.Controls)

{

if(control is TextBox)

{

MessageBox.Show("TextBox");

TextBoxHelper.ResetTextBox((TextBox)control);

}


else if(control is DataGridView)

{

// TODO: Check form state before removing data

DataGridViewHelper.ClearDataGridView((DataGridView)control);

}


// For syncfusion

else if (control is MultiColumnComboBox)

{

MessageBox.Show("MultiColumn");

SyncfusionHelper.ComboBoxHelper.ResetComboBox((MultiColumnComboBox)control);

}

}

}


Syncfusion Helper.cs

public static class SyncfusionHelper

{

public static class ComboBoxHelper

{

public static void ResetComboBox(MultiColumnComboBox multiColumnComboBox)

{

multiColumnComboBox.SelectedItem = null;

multiColumnComboBox.SelectedIndex = -1;

multiColumnComboBox.UpdateText(true);

multiColumnComboBox.TextBox.Text = String.Empty;

}

}


}





Please let me know whatever I am missing here


4 Replies

AM Ammar June 22, 2022 07:30 PM UTC

Still waiting for a solution



AM Ammar June 23, 2022 06:14 AM UTC

Please provide a solution I need to get this over with my task is long overdue



AM Ammar June 23, 2022 07:59 AM UTC

Its honestly really frustrating to ask a simple question here, all I want is a solution to a minor problem and I've been waiting for almost 2 days   



BA BagavathiPerumal Apranandham Syncfusion Team June 23, 2022 09:03 AM UTC

Hi Ammar,



Sorry for the delay in getting back to you.

We are unable to reproduce the issue at our end; however, we've created a sample uses the button click event to clear the MultiColumnComboBox's content and also attached video for your reference. please provide more details about the requirement, or modify our sample and revert to us with a reproducible issue or video. So, it will be helpful to prompt the solution further.



Attachment: MuliColumnComboBox_WinForms_137bd142.zip


Regards,
Bagavathi Perumal


Loader.
Up arrow icon