Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
UltraGrid Copy Row
posted

I am new to C# and the UltraGrid.

I want to add a WinForm Copy button that  will paste all highlighted grid rows into the current Ultragrid as new rows (I have an identity field column, so, dupes will not be an issue.)

I guess I am just not 'getting' it yet as googling and help searching has not helped. I would have thought this would be such a simple, built in feature that would be easy to find and implement???

2 QUESTIONS:

1) Does anyone have the C# button code that will copy the highlighted grid row(s) and paste into the same grid?

2) Does anyone have the code (or settings) to do the same copy in a Ctlr/C Ctrl/V copy ppaste in the grid?

Parents
No Data
Reply
  • 811
    Suggested Answer
    posted

    Watson,

    You can refer the following help article from Infragistics:

    http://help.infragistics.com/Help/NetAdvantage/WinForms/2009.1/CLR2.0/html%5CWinGrid_Creating_an_Edit_Menu_with_Clipboard_Operations_for_WinGrid.html


    and following code will help you to copy and paste the grid data:

            private void btnCopy_Click(object sender, System.EventArgs e)
            {
                this.UltraGrid1.PerformAction(UltraGridAction.Copy);
            }

            private void btnPaste_Click(object sender, System.EventArgs e)
            {
                this.UltraGrid1.PerformAction(UltraGridAction.Paste);
            }

    Thank you.

    Bunty :)

Children