When i pasted selected colums or rows from Excel by clipboard, spreadsheet add many void cell without data into end of document.
How to paste only cells with data from clipboard?
Or how to fast remove void columns or void rows from worksheet?
Thanks.
I just wanted to expand on what Maria mentioned. Essentially the xamSpreadsheet tries to mimic much of the Excel behavior and that includes the clipboard support. Much of the paste handling is internal to the control and about the only thing specifically exposed is the ability to control which clipboard data format we use to process the paste. If you wanted to do that (which would be similar to pasting in excel but having removed the other data formats from the clipboard or for example what might happen if you selected tab separated text in Notepad and copied them to the clipboard) then you can handle the DataObject.Pasting attached event (e.g. use the AddHandler method of the xamSpreadsheet and pass in DataObject.Pasting and an event handler of type DataObjectPastingEventHandler) and change/set the FormatToApply to one of the other formats available in the DataObject passed to that event - you can see what happens to be in the clipboard for that specific clipboard operation using the GetFormats method of the DataObject but of course which formats are in the clipboard will depend on the object/application that put the information into the clipboard so you couldn't hard code to a particular format. We'll default to using the Excel information if available but we do support pasting from a couple of the text formats like CSV and TSV (e.g. DataFormats.CommaSeparatedValue and DataFormats.UnicodeText respectively).
Outside of that you would need to pull the data out of the clipboard, use your own code to parse it and update the worksheet directly. You can handle the CommandExecuting event and look for when the Command property of that event args is Paste, set the Cancel property to true to prevent the control from performing the paste.
Hello Igor,
I have been looking into this behavior and currently there is no built-in functionality that will remove the empty rows and columns in the pasted worksheet. You can consider adding this as a suggestion at http://ideas.infragistics.com/. Submitting your idea will allow you to communicate directly with our product management team, track the progress of your idea at any time, see how many votes it got, read comments from other developers in the community, and see if someone from the product team has additional questions for you.Remember when submitting your idea to explain the context in which a feature would be used and why it is needed as well as anything that would prevent you from accomplishing this today. You can even add screenshots to build a stronger case. Remember that for your suggestion to be successful, you need other members of the community to vote for it. You can also link back to this thread for additional details.You may also have a look at the SpreadsheetCommandType enumeration. It provides values for operations to be taken. E.g. the LastUsedCell can be used to navigate to the last cell with data:var command = new SpreadsheetCommand(SpreadsheetCommandType. LastUsedCell); command.Execute(this.xamSpreadsheet1);Here is a documentation page with all the commands that could be used http://help.infragistics.com/Help/Doc/WPF/2015.2/CLR4.0/html/InfragisticsWPF4.Controls.Grids.XamSpreadsheet.v15.2~Infragistics.Controls.Grids.SpreadsheetCommandType.html Let me know if you have any other questions.