ClipboardOptions

Posted by: caoweidehao on 8 September 2017, 12:58 pm EST

  • Posted 8 September 2017, 12:58 pm EST

    [Me.FpSpread1.ClipboardOptions = FarPoint.Win.Spread.ClipboardOptions.AllHeaders]


    if Spread's Rowheader text has been setted,when I  cut the whole row ,the Spread's Rowheader text has been cut.


    [Me.FpSpread1.ClipboardOptions = FarPoint.Win.Spread.ClipboardOptions.NoHeaders]


    but when i copy the rowdata to Excel ,the Spread's Rowheader text  is not existed.


    what can i do for that?

  • Replied 8 September 2017, 12:58 pm EST

    you are right.


    but when I  copy to Excel file,I hope that the headers also are copied.

  • Replied 8 September 2017, 12:58 pm EST

    Hello,


    You would need to change the ClipboardOptions in order to copy the headers.

  • Replied 8 September 2017, 12:58 pm EST

    thanks to scotts,


    if I  cut data,I hope that the header text is not cutted,but when copy to the Excel File the header text is also Pasted.


     

  • Replied 8 September 2017, 12:58 pm EST

    Hello,


    When you set the ClipboardOptions to NoHeaders, the headers are not copied.

  • Replied 8 September 2017, 12:58 pm EST

    Hello,


    You can set up your own ActionMap to handle the Cut the way you want it done, so it does not cut the Headers.

     
    	Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim im As FarPoint.Win.Spread.InputMap
    Dim am As FarPoint.Win.Spread.ActionMap = FpSpread1.GetActionMap()
    im = FpSpread1.GetInputMap(FarPoint.Win.Spread.InputMapMode.WhenFocused)
    im.Put(New FarPoint.Win.Spread.Keystroke(Keys.X, Keys.Control), "SpecialCut")
    am.Put("SpecialCut", New SpcCut)
    FpSpread1.ClipboardOptions = FarPoint.Win.Spread.ClipboardOptions.AllHeaders

    End Sub
    End Class

    Public Class
    SpcCut
    Inherits FarPoint.Win.Spread.Action
    Public Overrides Sub PerformAction(ByVal sender As Object)
    Dim ss As FarPoint.Win.Spread.SheetView = CType(sender, FarPoint.Win.Spread.SpreadView).GetSheetView
    ss.ClipboardCopy()
    ss.ClearRange(ss.GetSelection(0).Row, 0, ss.GetSelection(0).RowCount, ss.ColumnCount, True)
    End Sub
    End Class

     
  • Replied 8 September 2017, 12:58 pm EST

    thank you very muck!


    it greatly work for me.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels