Please help me to resolve this:
I am working on an Ultragrid that allows multi cells selection. Currently we I click on a cell, the whole row is selected/highlighted. I could then multi select rows, but can't select group of cells. The purpose of multi select cells is to implement copy and paste data to Excel. Please help. Thanks.
Have you done the following:
e.Layout.Override.AllowMultiCellOperations = AllowMultiCellOperation.All;
This feature was added in version 6.1 and you can find more information about it in the online documentation. I went to the What's new in version 6.1 section to look there first.
Nick
Thank you Nick. I changed some Override properties and now I can select a particular cell. But is there a way to multi select cells by dragging the cursor? Something similar to the Excel. I tried changing AllowMultiCellOperations to All and that doesn't help multi selecting cells.
Here is a snippet of the code provided in frmCutCopyPaste in the CSSamplesExplorer sample code that should have been installed along with your system:
// Turn on all of the Cut, Copy, and Paste functionality. e.Layout.Override.AllowMultiCellOperations = AllowMultiCellOperation.All;
// In order to cut or copy, the user needs to select cells or rows. // So set CellClickAction so that clicking on a cell selects that cell // instead of going into edit mode. e.Layout.Override.CellClickAction = CellClickAction.CellSelect;
Click on a cell then in a corner cell ctrl+Shift to select the range.
Thanks Nick and Mike. Yes, after changing values in CellClickAction and SelectTypeCell, I got what I was looking for. Thanks again for the information.
You need to look at properties like CellClickAction and SelectTypeCell on the Override object. These are the properties the control whether selecting cells is allowed and the limitations.
Leave everything in the designer set to the default. Place the overrides shown in the previous message inside the InitializeLayout event. There is code for the SamplesExplorer available in both VB and CS if samples were installed on your computer. When running the SamplesExplorer look at the 6.1 Cut Copy Paste example in the menu. The source code for it is found in frmCutCopyPaste. There are no overrides I could find other that the two previously referenced.
You can either drag select or use the ctrl+Shift method. Just ran the SamplesExplorer and was successful in pasting into Excel.
It's not in edit mode and Ctrl + Shift doesn't allow me to select the range. What could be wrong? In Feature Picker to configure the control setting, it performs exactly what I am looking for in the Preview. I set Row Selection = Default behavior, Column Selection=Extended select and Cell Selection=Extended select. Please advise.Thanks.