fiogf49gjkf0d Does anyone have a Datagrid popup menu code with clipboard options?
This is in the LAN 7.5.3 version running on SQL Server 2005
I am storing a hyperlink in one column and a description in another of a datagrid. I added a button to add and select a new row in the grid to avoid the need to frequently open an edit form. The keyboard Ctl+ XCV work, and now I am working on the popup menu. I am getting and setting the grid's ID, Column, and Value on the MouseDown and MouseUp events, and the comparing to see if they changed cells. The inconsistancy comes depending on whether the whole cell's content is selected. I thought that SetFieldValue would update the whole cell even if only part of it was selected.
Sub dgHyperlinkPopupMenuClick(Sender, Item) 'breakpoint
'dgHyperlink.Selection.Item( ' .Selection 'Application.Clipboard.AsText = "KeyId: " & strHyperlinkId & " FieldName: " & strHyperlinkColumn & " Value: " & strHyperlinkValue
If IsNull(strHyperlinkID) Or IsEmpty(strHyperLinkId) Then Msgbox "Select a Cell." Exit Sub End If
Select Case Item.Caption Case "&Cut" Application.Clipboard.AsText = strHyperlinkValue & "" ' dgHyperlink.SetFieldValue strHyperlinkId, strHyperlinkColumn, strHyperlinkValue, True dgHyperlink.SetFieldValue strHyperlinkId, strHyperlinkColumn, "", True Case "C&opy" Application.Clipboard.AsText = strHyperlinkValue & "" Case "& aste" dgHyperlink.SetFieldValue strHyperlinkId, strHyperlinkColumn, Application.Clipboard.AsText, True Case "C&lear Cell" dgHyperlink.SetFieldValue strHyperlinkId, strHyperlinkColumn, "", True Case Else Msgbox Item.Caption & " is not a valid option." End Select
End Sub
Thanks for your help in advance. |