We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Paste

I want to validate paste in my grid. If a user paste text that is not correct in a cell, I want to cancel the paste. Wich event and how to cancel or undo the paste?

9 Replies

AD Administrator Syncfusion Team June 28, 2004 11:48 AM UTC

Is this the same issue from http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=15720? I think you should be able to use PasteCellText to manage this. Below is a sample. Is the problem you are having occurring when you try to paste a sinle value into a single actively editing cell. If so, the grid does not handle the paste in this situation, the cell control does. To do dynamic validation at this level will require handling an event on the cell control. It is probably doable, but will take some effort. The sample below just by passes this problem by by calling CurrentCell.EndEdit when you do a paste. PasteValidation_2879.zip


AD Administrator Syncfusion Team June 28, 2004 12:00 PM UTC

Yes, but PasteCellText never fire!!!!! I paste text in one on many cell but the event PsteCellText is not raised! >Is this the same issue from http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=15720? > >I think you should be able to use PasteCellText to manage this. Below is a sample. > >Is the problem you are having occurring when you try to paste a sinle value into a single actively editing cell. If so, the grid does not handle the paste in this situation, the cell control does. To do dynamic validation at this level will require handling an event on the cell control. It is probably doable, but will take some effort. The sample below just by passes this problem by by calling CurrentCell.EndEdit when you do a paste. > >PasteValidation_2879.zip > >


AD Administrator Syncfusion Team June 28, 2004 12:03 PM UTC

Does it fire for you in the sample I attached? If it does not, what version of our code are you using? Can you attach a project that shows the problem?


FO Francis Ouellet June 28, 2004 12:25 PM UTC

I get this error when I try to open PasteValidation.sln : The application for project c:\temps\PasteValidation.sln is not installed. Make sure the application for the project type .csproj is installed.


AD Administrator Syncfusion Team June 28, 2004 12:35 PM UTC

If you look in the zip file, you will see the proj file. There is also a VB project file. Are you trying to open the solution file directly from the zip. If so, this may not work as the projects are 2002 projects. Try opening Vis Stu, and use File | Open | Project and try opening the project file directly (not the solution). If you are using 2003, then you should get a prompt to convert the project.


FO Francis Ouellet June 28, 2004 12:42 PM UTC

I always get the same error. But I can open then project and convert it. The PasteCellText event is raised and work fine. But for my application the event is not raised. Maybe because my form is an mdi child?


AD Administrator Syncfusion Team June 28, 2004 12:53 PM UTC

I suspect the problem is not related to MDI stuff. Here is a little sample where the event fires OK for me (al long as you are not trying to paste a single string into an actively editing cell). MDI_8371.zip Can you post a sample that shows the problem?


FO Francis Ouellet June 28, 2004 01:49 PM UTC

Wich version are you using? Me it''s 1.6.1.0


AD Administrator Syncfusion Team June 28, 2004 02:20 PM UTC

I am using the 2.0 code base. You should at least upgrade to 1.6.1.8 if you want to use 1.6 code. You can do so from your Direct Trac home page. To run the MDIsample on earlier code, just try commenting out any lines that give syntax errors (usually, there are 2 or 3 in in the Designer generated code).

Loader.
Live Chat Icon For mobile
Up arrow icon