Spread for WinForms allows users to deselect the selected cells just like in Excel. In order to deselect a selection, users simply need to press and hold the ctrl key or cmd key on the keyboard and use the left, top, right or down arrow keys to deselect the cells that they want.
The deselection feature is useful especially when users mistakenly select extra cells within a spreadsheet. With large worksheets carrying huge amounts of data, it becomes cumbersome to deselect the unnecessary cells. Using the ctrl or cmd key, users can efficiently manage the entire process of deselection without having to start over; thus saving both time and efforts.
In order to demonstrate the working of deselection behavior, some example images are shared below:
After deselection, the new selection will be created as per the following rules:
This example code shows how to work with deselections in a spreadsheet.
C# |
Copy Code
|
---|---|
fpSpread1_Sheet1.SelectionUnit = FarPoint.Win.Spread.Model.SelectionUnit.Cell; fpSpread1_Sheet1.SelectionPolicy = FarPoint.Win.Spread.Model.SelectionPolicy.MultiRange; // Adding Selection fpSpread1.Sheets[0].AddSelection(0, 0, 10, 5); var sels = fpSpread1.ActiveSheet.GetSelections(); Console.WriteLine(sels.Length); // Removing selection from selected range of cells fpSpread1.Sheets[0].RemoveSelection(2, 2, 2, 1); fpSpread1.Sheets[0].RemoveSelection(5, 1, 2, 3); fpSpread1.Sheets[0].RemoveSelection(8, 3, 1, 1); |
VB |
Copy Code
|
---|---|
fpSpread1_Sheet1.SelectionUnit = FarPoint.Win.Spread.Model.SelectionUnit.Cell fpSpread1_Sheet1.SelectionPolicy = FarPoint.Win.Spread.Model.SelectionPolicy.MultiRange 'Adding Selection fpSpread1.Sheets(0).AddSelection(0, 0, 10, 5) Dim sels = fpSpread1.ActiveSheet.GetSelections() Console.WriteLine(sels.Length) 'Removing selection from selected range of cells fpSpread1.Sheets(0).RemoveSelection(2, 2, 2, 1) fpSpread1.Sheets(0).RemoveSelection(5, 1, 2, 3) fpSpread1.Sheets(0).RemoveSelection(8, 3, 1, 1) |