wpftableviewdevexpressdevexpress-wpfdevexpress-gridcontrol

WPF Devexpress 18.2 Grid /Tableview Paste pastes only 242 columns


I am using a WPF Devexpress GridControl with dynamic columns generated. UI Rendered all columns one column per month from years(let say 2020 to 2070). So I am trying copy values for a row from excel which has values from 2020 to 2061 which is approximately 500 values/cells. But the default TableView.OnPaste() only copies 242 cells. I tried various ways to figure out why is that? But no use.

I disabled virtualization, tried to scroll all the way to make sure columns are rendered everything is there and another interesting thing is:

TableView Evnent: ClipboardRowCellValuePasting=void OnClipboardRowCellValuePasting(object sender, ClipboardRowCellValuePastingEventArgs e)

this event is called for all 500 cells but after 242 cells the values are blanked. So its definitely in the paste implementation it is setting values to null after certain limit.

So can anyone suggest how to fix this?


Solution

  • Answer from Devex

    To avoid this shortcoming, it's necessary to change the clipboard source priority using the SourcePriority property as follows:

    ClipboardSourceFactory<ColumnWrapper, RowBaseWrapper>.SourcePriority = new ClipboardSourceType[]
    {
        ClipboardSourceType.XMLSpreadsheet,
        ClipboardSourceType.Excel,
        ClipboardSourceType.Csv,
        ClipboardSourceType.UnicodeText,
        ClipboardSourceType.Text
    };