Hi,
Simple question. I have a grid with a datasource. The users want to be able to copy the text from a given cell to the clipboard so they can paste it somewhere else.
If I make the grid read/write, then it works just fine. But the users can then edit the data. If I make the grid (or rows, cells, etc.) read only, then they can't select the text and copy it to the clipboard.
How can I allow them to select the contents of a cell and copy it to the clipboard?
FWIW, it appears that the cell contents are selected, but when I use CTRL-C, nothing happens.
My code for ^C in my menu is as follows:
Dim c As Control
If Me.HasChildren Then
c = Me.ActiveMdiChild.ActiveControl
Else
c = ActiveControl()
End If
If Not c Is Nothing AndAlso TypeOf c Is TextBoxBase Then<br/> DirectCast(c, TextBoxBase).Copy()
End If
Again, this works fine if I make the grid read/write - which I don't want to do.
Oh, I did try some simple code to save the data on cell entry and restore it on cell leave, but that didn't seem to work reliably (but it may have been my approach.)
I am guessing there is a simple setting that allows this, but I can't find it anywhere.
Any help is appreciated.
Thanks,
FletcherJ