We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Another question for MultiColumn Combobox

Hi, I have another question for MultiColumn Combobox. If I left click on the MultiColumn Combobox, The dropDwon list also appear. How can I get rid of it? I want to show my own context menu when I left click multicolumn combox. In the regular combox, I did not see this probelm. Thanks a lot. --Shuyang He

3 Replies

AD Administrator Syncfusion Team September 27, 2004 09:42 PM UTC

Hi Shuyang, I do see this problem here when the MultiColumnCombobox is in DropDownList mode. You could workaround this problem by handling the MultiColumnCombobox.PopupContainer''s BeforePopup event as shown below : this.multiColumnComboBox1.PopupContainer.BeforePopup += new CancelEventHandler(PopupContainer_BeforePopup); private void PopupContainer_BeforePopup(object sender, CancelEventArgs args) { if (Control.MouseButtons == MouseButtons.Right) { args.Cancel = true; this.contextMenu1.Show(this.multiColumnComboBox1, this.multiColumnComboBox1.PointToClient(Control.MousePosition)); } } I have attached a complete sample that demonstrates the above mentioned workaround. Please refer to it and let me know if you need further assistance. Regards, Guru Patwal Syncfusion, Inc.


SH Shuyang He November 22, 2006 10:56 PM UTC

Hi,
1) is there anyway I can prevent user to enter
invalide char?
For example:
I have two items:
as
asd
if user enter asb, i don't want b shows on dropdown box.

2) use same example as above. when I type "as", multi combox actaully select "asd" instead of "as". Is this by design? I would like combox keep selection on "as".

Thanks.

--Shuyang He


AR Anupama Roy Syncfusion Team November 23, 2006 07:36 AM UTC

Hi Shuyang,

Here goes the answer for your questions.

1) Is there anyway I can prevent user to enter invalide char?

Currently Essential Studio MultiColumnComboBox does not exhibit a property or an event that would validate the user entries which are not there in the list.However,as a workaround I can suggest you to handle the TextChanged event and do a validation based on the index returned by FindStringExact() method as shown below.Here in the example,if the text is not found in the internal ListBox list,it will show up a standard message and will clear the text in the TextBox.

public void clear()
{
this.multiColumnComboBox1.TextBox.Text =null;
this.multiColumnComboBox1.ListBox.SelectedIndex =-1;
}

private void multiColumnComboBox1_TextChanged(object sender, System.EventArgs e)
{
if(-1==this.multiColumnComboBox1.FindStringExact (this.multiColumnComboBox1.TextBox.Text,true))
{

MessageBox.Show ("Invalid Entry");
clear();

}
}

2) Regarding second query,if you ask me whether it is by design,answer is yes,internal AutoComplete behavior is currently like this.However,I understand the requirement and it sounds to be the expected behavior of AutoCompletion and hence i should say it is a bug.As the AutoComplete codings are completely sealed,I am afraid I cannot provide you a workaround for now.However,we will be modifying our source code soon in order to reflect the changes as requested.Till then we kindly request you to bear with us.

I am not including a sample here as we are not sure about the Essential Studio version you are working with.If you would like to have a look at the implementation of this code,kindly let me know your framework details as well as Essential Studio version details so that I can include it here.

Please feel free to get back to us if you need further assistance.

Thanks,

Anu.

Loader.
Live Chat Icon For mobile
Up arrow icon