You are not logged in.
This forum has been archived and no longer accepts new user registrations. Please report your questions, problems, and feedback to the issue page of ReoGrid on GitHub. Thank you for your cooperation.
Pages: 1
Topic closed
I would like to know how can if the someone paste text into the cell it will remove the text? I have the could to check the cell for numeric only but that is if the click on the cell and add it, but it does not work if they paste text into the cell..
Thank you
Shane
Offline
You could use the 'BeforePaste' event, see http://reogrid.net/document/clipboard/ and Demo program for 'Clipboard Events'.
Good luck!
Offline
here is the code i use to do what i wanted
thought i would share it someone else wanted to use it
this basically checks for numeric values if you paste into grid from the clip board.. and if alpha is found it sets the that value to nothing
With grid
Dim data(,) As Object
Dim range As ReoGridRange
data = RGUtility.ParseTabbedString(Clipboard.GetText)
range = New ReoGridRange(.SelectionRange.Row, .SelectionRange.Col, data.GetLength(0), data.GetLength(1))
For i As Integer = 0 To data.GetLength(0) - 1
For j As Integer = 0 To data.GetLength(1) - 1
If Not IsNumeric(data(i, j)) Then
e.IsCancelled = True
data(i, j) = Nothing
End If
Next
Next
.DoAction(New RGSetRangeDataAction(range, data)) 'So you can use undo and redo
End With
Last edited by asparatu (2014-08-28 04:19:04)
Offline
Great! Thanks for sharing.
Offline
Pages: 1
Topic closed