GrapeCity.Windows.SpreadSheet.Data Namespace > Worksheet Class > AddSelection Method : AddSelection(Int32,Int32,Int32,Int32,Boolean) Method |
'Declaration Public Overloads Sub AddSelection( _ ByVal row As System.Integer, _ ByVal column As System.Integer, _ ByVal rowCount As System.Integer, _ ByVal columnCount As System.Integer, _ ByVal moveAnchorCell As System.Boolean _ )
'Usage Dim instance As Worksheet Dim row As System.Integer Dim column As System.Integer Dim rowCount As System.Integer Dim columnCount As System.Integer Dim moveAnchorCell As System.Boolean instance.AddSelection(row, column, rowCount, columnCount, moveAnchorCell)
public void AddSelection( System.int row, System.int column, System.int rowCount, System.int columnCount, System.bool moveAnchorCell )
private void Window_Loaded(object sender, RoutedEventArgs e) { GrapeCity.Windows.SpreadSheet.Data.CellRange cellr = new GrapeCity.Windows.SpreadSheet.Data.CellRange(0, 0, 3, 3); GrapeCity.Windows.SpreadSheet.Data.CellRange cellr2 = new GrapeCity.Windows.SpreadSheet.Data.CellRange(4, 0, 2, 2); gcSpreadSheet1.Sheets[0].SelectionPolicy = GrapeCity.Windows.SpreadSheet.Data.SelectionPolicy.MultiRange; //gcSpreadSheet1.Sheets[0].SetSelection(0, 0, 3, 3); gcSpreadSheet1.Sheets[0].SetSelection(cellr); //gcSpreadSheet1.Sheets[0].AddSelection(4, 0, 2, 2); //gcSpreadSheet1.Sheets[0].AddSelection(cellr2); gcSpreadSheet1.Sheets[0].AddSelection(cellr2, true); //gcSpreadSheet1.Sheets[0].AddSelection(4, 0, 2, 2, true); //Specifies the extent (or farthest cell) in the selection of cells. gcSpreadSheet1.Sheets[0].ExtendSelection(6, 3); gcSpreadSheet1.Invalidate(); } private void button1_Click(object sender, RoutedEventArgs e) { GrapeCity.Windows.SpreadSheet.Data.CellRange cellr3 = new GrapeCity.Windows.SpreadSheet.Data.CellRange(0, 0, 3, 3); listBox1.Items.Add(gcSpreadSheet1.Sheets[0].IsAnyCellInColumnSelected(0).ToString()); listBox1.Items.Add(gcSpreadSheet1.Sheets[0].IsAnyCellInRowSelected(10).ToString()); listBox1.Items.Add(gcSpreadSheet1.Sheets[0].IsSelected(3, 3).ToString()); //gcSpreadSheet1.Sheets[0].ClearSelections(); //gcSpreadSheet1.Sheets[0].ClearSelection(0, 0, 3, 3); //gcSpreadSheet1.Sheets[0].ClearSelection(cellr3); gcSpreadSheet1.Invalidate(); }
Private Sub Window_Loaded(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles MyBase.Loaded Dim cellr As New GrapeCity.Windows.SpreadSheet.Data.CellRange(0, 0, 3, 3) Dim cellr2 As New GrapeCity.Windows.SpreadSheet.Data.CellRange(4, 0, 2, 2) GcSpreadSheet1.Sheets(0).SelectionPolicy = GrapeCity.Windows.SpreadSheet.Data.SelectionPolicy.MultiRange 'GcSpreadSheet1.Sheets(0).SetSelection(0, 0, 3, 3) GcSpreadSheet1.Sheets(0).SetSelection(cellr) 'GcSpreadSheet1.Sheets(0).AddSelection(4, 0, 2, 2) 'GcSpreadSheet1.Sheets(0).AddSelection(cellr2) GcSpreadSheet1.Sheets(0).AddSelection(cellr2, True) 'GcSpreadSheet1.Sheets(0).AddSelection(4, 0, 2, 2, True) 'Specifies the extent (or farthest cell) in the selection of cells. GcSpreadSheet1.Sheets(0).ExtendSelection(6, 3) GcSpreadSheet1.Invalidate() End Sub Private Sub Button1_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles Button1.Click Dim cellr3 As New GrapeCity.Windows.SpreadSheet.Data.CellRange(0, 0, 3, 3) ListBox1.Items.Add(GcSpreadSheet1.Sheets(0).IsAnyCellInColumnSelected(0).ToString()) ListBox1.Items.Add(GcSpreadSheet1.Sheets(0).IsAnyCellInRowSelected(10).ToString()) ListBox1.Items.Add(GcSpreadSheet1.Sheets(0).IsSelected(3, 3).ToString()) 'GcSpreadSheet1.Sheets(0).ClearSelections() 'GcSpreadSheet1.Sheets(0).ClearSelection(0, 0, 3, 3) 'GcSpreadSheet1.Sheets(0).ClearSelection(cellr3) GcSpreadSheet1.Invalidate() End Sub
Target Platforms: Windows 7, Windows 8 Desktop, Windows Vista SP1 or later, Windows Server 2000, Windows 2000 Professional, Windows XP Professional, Windows NT 4.0 Workstation, SP6, Windows NT 4.0 Server, SP6