FlexGrid for WinForms
ColSel Property
Example 



Gets or sets the last column in the current selection.
Syntax
'Declaration
 
<BrowsableAttribute(False)>
<DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden)>
Public Property ColSel As Integer
'Usage
 
Dim instance As C1FlexGridBase
Dim value As Integer
 
instance.ColSel = value
 
value = instance.ColSel
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public int ColSel {get; set;}
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public:
property int ColSel {
   int get();
   void set (    int value);
}
Remarks

Use the RowSel and ColSel properties to modify a selection or to determine which cells are currently selected. Columns and rows are numbered from zero, beginning at the top for rows and at the left for columns.

Setting the Row and Col properties automatically collapses the selection to a single cell, resetting the RowSel and ColSel properties. Therefore, to specify a block selection, you must Row and Col, then RowSel and ColSel. Alternatively, you may use the Select(CellRange,Boolean) method to select a range with a single statement.

When a range is selected, the value of Row may be greater than or less than RowSel, and Col may be greater than or less than ColSel. This is inconvenient when you need to set up bounds for loops. In these cases, you can use the Selection property to retrieve a normalized CellRange object, where r1 <= r2 and c1 <= c2.

Example
The code below loops though the cells in the current selection:
CellRange rg = flex.Selection;
for (int r = rg.r1; r <= rg.r2; r++)
  for (int c = rg.c1; c <= rg.c2; c++)
    Console.WriteLine("the value at {0} {1} is {2}", r, c, flex[r, c]);
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

C1FlexGridBase Class
C1FlexGridBase Members

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Send Feedback