Copy and paste from Excel/Notepad in to dropdown cell

I'm having an issue copying from Excel/Notepad in to a grid that has a dropdown cell. The cell value can be either YES or NO. If they paste a lower case no from excel, I then catch that in the grid pastecelltext event and upper case it before it pastes it. I also catch this in our copy one to many clipboardpaste function. When I put a lower case no in notepad and copy it to one cell in the grid it doesn't go to my pastecelltext event. Is there a way I can catch this also and upper case it or just to make anything that goes in this cell automatically be uppercased by default? I've attached a sample of this.

CopyPasteDropDown.zip

1 Reply

AD Administrator Syncfusion Team April 26, 2007 01:05 PM UTC

There is a CharacterCasing style property that you can set for TextBoxBase based cell controls that can force the case of a cell. But this will not affect the copy-paste process that you are using.

But there is a property (IgnoreCurrentCell) on the CutPaste event args that you can set so that pasting a single cell is handled the same as a multi-cell paste. This forces the PasteCellText event to be raised even for single cells.

Private Sub GC1_ClipboardPaste(ByVal sender As Object, ByVal e As GridCutPasteEventArgs) Handles GC1.ClipboardPaste

Dim blnHandled As Boolean
GC1.BeginUpdate()
e.IgnoreCurrentCell = True
blnHandled = ClipboardPaste(GC1)
GC1.EndUpdate()
GC1.Refresh()
e.Handled = blnHandled

End Sub


Setting this property made your sample display NO even for a single cell copy/paste for me.

Loader.
Up arrow icon