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
65
UltraGrid copy Column(s) and Past in Excel
posted

Hi,

selecting one or more Headers in the UlttraGrid and pressing Strg-C, copies the first Header and left upper cell. The cell selection below the selected Headers is correct.

The grid should work similar as Excel. The User shoulod be able to select several culumns, by clicking on the header and copy the values incl. the header text into a excel sheet.

I use the following settings:

grid.DisplayLayout.CaptionVisible = Infragistics.Win.DefaultableBoolean.False;
grid.DisplayLayout.ColScrollRegions.Add(colScrollRegion1);
grid.DisplayLayout.ColScrollRegions.Add(colScrollRegion2);
grid.DisplayLayout.Override.AllowAddNew = Infragistics.Win.UltraWinGrid.AllowAddNew.No;
grid.DisplayLayout.Override.AllowDelete = Infragistics.Win.DefaultableBoolean.False;
grid.DisplayLayout.Override.AllowMultiCellOperations = ((Infragistics.Win.UltraWinGrid.AllowMultiCellOperation)((Infragistics.Win.UltraWinGrid.AllowMultiCellOperation.CopyWithHeaders | Infragistics.Win.UltraWinGrid.AllowMultiCellOperation.Paste)));
grid.DisplayLayout.Override.RowSizingArea = Infragistics.Win.UltraWinGrid.RowSizingArea.RowBordersOnly;
grid.DisplayLayout.Override.SelectTypeCell = Infragistics.Win.UltraWinGrid.SelectType.Extended;
grid.DisplayLayout.Override.SelectTypeCol = Infragistics.Win.UltraWinGrid.SelectType.Extended;
grid.DisplayLayout.Override.SelectTypeRow = Infragistics.Win.UltraWinGrid.SelectType.Extended;
grid.DisplayLayout.Override.SummaryDisplayArea = Infragistics.Win.UltraWinGrid.SummaryDisplayAreas.None;
grid.DisplayLayout.Scrollbars = Infragistics.Win.UltraWinGrid.Scrollbars.Both;
grid.DisplayLayout.UseFixedHeaders = true;
grid.DisplayLayout.ViewStyle = Infragistics.Win.UltraWinGrid.ViewStyle.SingleBand;
grid.Dock = System.Windows.Forms.DockStyle.Fill;
grid.Location = new System.Drawing.Point(0, 0);
grid.Name = "grid";
grid.Size = new System.Drawing.Size(723, 584);
grid.TabIndex = 5;
grid.Text = "ultraGrid1";
grid.UseOsThemes = Infragistics.Win.DefaultableBoolean.True;
grid.Error += new Infragistics.Win.UltraWinGrid.ErrorEventHandler(grid_Error);
grid.KeyDown += new System.Windows.Forms.KeyEventHandler(grid_KeyDown);
grid.InitializeRow += new Infragistics.Win.UltraWinGrid.InitializeRowEventHandler(grid_InitializeRow);
grid.Validated += new System.EventHandler(grid_Validated);
grid.KeyPress += new System.Windows.Forms.KeyPressEventHandler(grid_KeyPress);
grid.InitializeLayout += new Infragistics.Win.UltraWinGrid.InitializeLayoutEventHandler(grid_InitializeLayout);
grid.AfterRowRegionScroll += new Infragistics.Win.UltraWinGrid.RowScrollRegionEventHandler(grid_AfterRowRegionScroll);
grid.AfterSelectChange += new Infragistics.Win.UltraWinGrid.AfterSelectChangeEventHandler(grid_AfterSelectChange);

Any Ideas how to solve this?

Parents
  • 469350
    Suggested Answer
    Offline posted

    Hi,

    You might want to look at the options on the AllowMultiCellOperations property. There is an option for Copy and a separate option of CopyWithHeaders. So be sure to choose the right one.

     

Reply Children