Copying from a RadListControl

1 Answer 37 Views
ListControl
Michael
Top achievements
Rank 1
Iron
Iron
Veteran
Michael asked on 29 Mar 2024, 10:36 AM

I would have thought that after selecting some rows in a RadListControl and hitting Ctrl-C it would copy the text from those rows, but no - it doesn't copy anything.  I also would have thought that there'd be a standard context menu if I were to right-click on it, but not that either.

Am I missing something, or is this the standard behavior of this control?  If it is, do you have some other listbox control that behaves the way I would expect?

1 Answer, 1 is accepted

Sort by
0
Nadya | Tech Support Engineer
Telerik team
answered on 29 Mar 2024, 02:27 PM

Hello, Michael,

RadListControl doesn't offer copy functionality out of the box. However you can achieve copy functionality easily by handling the KeyDown event. You can get the SelectedItem.Text and save it to the clipboard.

private void RadListControl1_KeyDown(object sender, KeyEventArgs e)
{
    if (e.KeyCode == Keys.C && (Control.ModifierKeys & Keys.Control) == Keys.Control)
    {
        var t = this.radListControl1.SelectedItem.Text;
        Clipboard.SetText(t);
    }
}

Then, you can paste the text wherever you want. 

As to the context menu, you can create your own RadContextMenu, add desired menu items and assign it to RadListControl. For more information about using RadContextMenu please refer to the folllowing link: Overview - WinForms ContextMenu - Telerik UI for WinForms

In addition, RadListView is a similar control to RadListControl. You can use the same suggestions regarding copy functionality and context menu in case you choose to use RadListView.

I hope this information is useful. Should you have any other questions please let me know.

Regards,
Nadya | Tech Support Engineer
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Michael
Top achievements
Rank 1
Iron
Iron
Veteran
commented on 29 Mar 2024, 02:29 PM

Yeah, thanks, I had figured I could do that, it just seems strange to not have the functionality built in.
Tags
ListControl
Asked by
Michael
Top achievements
Rank 1
Iron
Iron
Veteran
Answers by
Nadya | Tech Support Engineer
Telerik team
Share this question
or