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

Copy/Paste in ComboBoxBarItem

I'm using a ComboBoxBarItem with an editable listbox and adding that ComboBoxBarItem to a PopupMenu.

Is it possible to implement clipboard copy/paste (Ctrl+V, etc) to the textbox part of the ComboBoxBarItem? I've tried a couple of things like handling the KeyDown event for the ListBox property (of the ComboBoxBarItem) and I also handled the TextBoxBound event of the control thinking that I might be able to do something there but the event never seems to fire.

I'm using 5.2 libraries.

Thanks,
Mark




9 Replies

RA Rajagopal Syncfusion Team February 8, 2008 11:35 PM UTC

Hi Mark,

You need to get hold of the TextBox inside the ComboboxBarItem from the TextBoxBound event of the comboBoxBarItem. Then handle the KeyDown event of the textbox and do your paste there when Ctrl+V is pressed.

// TextBoxBound event of the comboBoxBarItem
void comboBoxBarItem1_TextBoxBound(object sender, Syncfusion.Windows.Forms.Tools.XPMenus.TextBoxBoundEventArgs args)
{
args.TextBox.KeyDown += new KeyEventHandler(TextBox_KeyDown);
}

void TextBox_KeyDown(object sender, KeyEventArgs e)
{
if (e.Control && e.KeyCode == Keys.V)
{

}
}

Let me know if you have any questions.

Regards,
Rajagopal



MA Mark Atkinson February 9, 2008 12:06 AM UTC

I tried exactly that because I saw some code in a different post and the TextBoxBound event never seemed to fire (see my original post).
Is it because the ComboBoxBarItem is in a Popup menu instead of some other kind of container or toolstrip menu?

>Hi Mark,

You need to get hold of the TextBox inside the ComboboxBarItem from the TextBoxBound event of the comboBoxBarItem. Then handle the KeyDown event of the textbox and do your paste there when Ctrl+V is pressed.

// TextBoxBound event of the comboBoxBarItem
void comboBoxBarItem1_TextBoxBound(object sender, Syncfusion.Windows.Forms.Tools.XPMenus.TextBoxBoundEventArgs args)
{
args.TextBox.KeyDown += new KeyEventHandler(TextBox_KeyDown);
}

void TextBox_KeyDown(object sender, KeyEventArgs e)
{
if (e.Control && e.KeyCode == Keys.V)
{

}
}

Let me know if you have any questions.

Regards,
Rajagopal





MA Mark Atkinson February 19, 2008 01:52 AM UTC

Just checking in. Any other ideas on this?



AD Administrator Syncfusion Team February 20, 2008 08:24 AM UTC

Hi Mark,

Thank you for your update.

I am afraid that I was not able to reproduce the issue mentioned here. Could you please provide us the simple sample that illustrates this, so that it would be more helpful for us to sort out the cause of issue and provide you a better solution?

Please let me know if any concerns.

Regards,
Fathima



AD Administrator Syncfusion Team December 5, 2008 05:33 PM UTC

It's been a while since I started this thread but the issue has come up again withour clients.
We're not able to paste text into a ComboBoxBarItem.
I've attached a zip file containing a sample that demonstrates the issue. I'm handling the TextBoxBound event as well as the KeyDown event for the TextBox but the KeyDown handler never seems to get invoked.

>Hi Mark,

Thank you for your update.

I am afraid that I was not able to reproduce the issue mentioned here. Could you please provide us the simple sample that illustrates this, so that it would be more helpful for us to sort out the cause of issue and provide you a better solution?

Please let me know if any concerns.

Regards,
Fathima





ComboBoxBarItem_c7b97ca2.zip


AD Administrator Syncfusion Team December 11, 2008 06:27 PM UTC

Has anyone at Syncfusion been able to reproduce the issue using the attached sample (from the last message)?



FS Fathima Shalini P Syncfusion Team December 12, 2008 10:58 AM UTC

Hi Mark,

We regret for the delay in getting back to you.

I am able to reproduce the issue that we are not able to paste the text into ComboBoxBarItem that is placed inside the PopupMenu. I have forwarded this to our developers for more analysis. We will get back to you on or before December 19th 2008 with more details.

Please let me know if any concerns.

Regards,
Fathima





AD Administrator Syncfusion Team January 11, 2009 09:20 PM UTC

Any chance there might be a cofix for this in an upcoming release?

thanks,
Mark



VS Vallarasu S Syncfusion Team July 6, 2011 06:24 AM UTC

Hi Mark,

I apologize for the long delay in getting back to you.

Please refer the attached Sample, which demonstrates how paste operation can be done in the ComboBoxBarItem, similarly you can have the copy and cut functions implemented as well.

Let me know if this helps.

Regards,
Vallarasu S.



Loader.
Live Chat Icon For mobile
Up arrow icon