I'm using the following RadTreeListView :
I try to implement the copy (from Excel) / paste (to the grid) like I've implemented in another RadGridView :
But what ever I do about the paste mode properties, the 'Ctrl+V' will never fires any event in my RadTreeListView.
I need to paste data from Excel in my grid respectings the Columns/Rows order.
Do you know why no event are fired ?
12 Answers, 1 is accepted
The reason why pasting is not performed with this configuration of the RadTreeListView control is that the CanUserSelect property is set to False.
The control's pasting mechanism needs the selected item(s) in order to perform the operation. What I can suggest is to either enable the selection or handle the process manually by creating a key binding for the Ctrl + V combination.
I hope this answers your query. Please let me know if I can further assist you in any way.
Thanks for your answer.
Even if CanUserSelect property is set to True, the past mode doesn't work.
I've implemented a CheckBox column to Set IsSelected property on my Object Model because I don't want user can select rows with the default selection (= click on each row).
There is another way to make works the past with nativ events ? Or implement a custom Ctrl + V behavior is the only way to do this ?
If after setting the CanUserSelect property to True, the pasting is not performed, I am assuming that the IsReadOnly property of the RadTreeListView is True. In that case, the pasting is also disabled. Can you try setting the IsReadOnly property to False and see if that enables the pasting?
If that is not an option for your scenario, you can also implement the logic manually as suggested by my colleague.
I hope you find this helpful.
Thank you for the answer.
The IsReadOnly property is set to True and with the following configuration I can paste one cell from Excel, but the value is applied to all fields.
I think it's because SelectionUnit property is set to FullRow.
> I I set it to Mixed or if I want to paste 2 or more cells, the paste mode doesn't work.
Probably, the best way to make works the pasting mode to the grid is to implement manually the behavior like Dilyan said, but I want to know if you can tell me the base to do this (events, best practices, etc...) ?
Thank you very much.
Thanks for the provided snippet.
I am uncertain whether it is actually necessary to implement the copy/paste functionality manually. Please, check out the attached project in which I tested the paste functionality with both FullRow and Mixed SelectionUnit and on my end it is working as intended. Can you examine it and see how it differs from the setup on your end?
Should you need any further assistance, may I kindly ask you to share a sample video demonstrating the copy/paste process on your end?
Thanks for the attached project, but I can't build it. I have the following error :
The tag 'RadTreeListView' does not exist in XML namespace 'http://schemas.telerik.com/2008/xaml/presentation'. In your project, I'm using the same .DLL used in my project.
Added question : Does your sample working with SelectionMode property set to Multiple ?
My name is Dilyan and I'm stepping in for my colleague Vladimir who is currently out of office.
I was able to successfully run the project Vladimir attached and recorded a short video of the pasting process at my end when using the Multiple SelectionMode. Please find the video attached to my reply.
In order to run the project Vladimir provided, I can suggest manually re-adding all of the required binary files:
Should you prefer, you can also use the ReferencesResolver extension to do this manually for you.
Please let me know whether you're able to successfully run the project and whether the behavior demonstrated in the video is in fact the desired one.
Thank you for the provided video.
It's very strange because is not the first Telerik project I tried to manipulate but only this one doesn't build, even after I added needed references.
The ReferencesResolver doesn't change anything.
For the fourth .dll files I'm using version n° : 2017.2.614.45.
I can't build the project :( => I attached to this post a screen of my problem.
Thakn you for your help.
Thank you for the provided image.
The error you observe is caused by the fact that the provided project targets .NET Framework 4.0 and the .dll files which are referenced are meant for the 4.5 version of the framework.
In order to successfully build and run the project, either change the project's version to 4.5 or reference the 4.0 binaries from the WPF40 folder of your UI for WPF installation.
Please let me know how this goes.
Thank you for your answer.
Now, I can run your sample project, and its working fine.
With the same configurations, the behavior doesn't working on my project and I don't know why.
In order for me to assist you further, would you find it possible to isolate the issue you're experiencing in your project in a smaller sample project? You can upload the project to a storage provider of your choice and provide a download link. I will then be more than happy to investigate the cause of the undesired behavior and suggest a viable solution.
Please let me know whether you would find this possible.
To do my work I've implemented properties like this :
=> The disadvantage of this way is the row isn't fully selected, but the behavior (copy/paste) working find.
Thank you for your help !