RadGridView - Copy Performance Issue

1 Answer 12 Views
GridView
Álvaro
Top achievements
Rank 1
Iron
Iron
Álvaro asked on 08 Apr 2024, 02:08 PM | edited on 09 Apr 2024, 08:19 AM

Hi!

I have a RadGridView (v2022.1.222.40) with a high amount of elements (~90000) and when trying to copy a column I see that the Copying is taking too long. Even if I do a dummy code processing the data.

I cancel all the formats except DataFormats.Text, and it still takes too much time.

I have thought about canceling all the formats and saving the data in a variable instead of the clipboard but if I cancel everything, the Pasting event won't be triggered later... Any suggestion?

Here is my code:

private void gridView_Copying(object sender, GridViewClipboardEventArgs e)
{
    if (e.Format != DataFormats.Text)
    {
        e.Cancel = true;
        return;
    }

    // Do some dummy code

    // Save it in the Clipboard
    e.DataObject.SetData(nameof(MyCustomModel), items);
}

1 Answer, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 11 Apr 2024, 09:40 AM

Hi Álvaro,

Thank you for reaching out to us.

You can try also to specify the DataFormat of the SetData() method with Text and UnicodeText to trigger the pasting. You can cancel all the formats and manually create the DataObject method. Here is what you can try:

DataObject dataObject = new DataObject();
dataObject.SetData(DataFormats.UnicodeText, false, data);
dataObject.SetData(DataFormats.Text, false, data);
Clipboard.SetDataObject(dataObject);

Give it a try and let me know how it goes.

Regards,
Dinko | 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.

Tags
GridView
Asked by
Álvaro
Top achievements
Rank 1
Iron
Iron
Answers by
Dinko | Tech Support Engineer
Telerik team
Share this question
or