GrapeCity.Xaml.SpreadSheet.Data
ActiveCell Property
Example 


Gets the active cell in the sheet.
Syntax
'Declaration
 
Public ReadOnly Property ActiveCell As Cell
'Usage
 
Dim instance As Worksheet
Dim value As Cell
 
value = instance.ActiveCell
public Cell ActiveCell {get;}

Property Value

The active cell in the sheet.
Example
This example uses the ActiveCell property.
private void Grid_Loaded_1(object sender, RoutedEventArgs e)
        {
            gcSpreadSheet1.Sheets[0].SetActiveCell(5, 5);
        }

        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            listBox1.Items.Add(gcSpreadSheet1.Sheets[0].ActiveCell.ToString());
            listBox1.Items.Add(gcSpreadSheet1.Sheets[0].ActiveColumn.ToString());
            listBox1.Items.Add(gcSpreadSheet1.Sheets[0].ActiveColumnIndex);
            listBox1.Items.Add(gcSpreadSheet1.Sheets[0].ActiveRow.ToString());
            listBox1.Items.Add(gcSpreadSheet1.Sheets[0].ActiveRowIndex);           
        }

        private void gcSpreadSheet1_EnterCell(object sender, GrapeCity.Xaml.SpreadSheet.UI.EnterCellEventArgs e)
        {
            listBox1.Items.Add(e.Column.ToString());
            listBox1.Items.Add(e.Row.ToString());
        }

        private void gcSpreadSheet1_LeaveCell(object sender, GrapeCity.Xaml.SpreadSheet.UI.LeaveCellEventArgs e)
        {
            listBox1.Items.Add(e.Column.ToString());
            listBox1.Items.Add(e.Row.ToString());
        }
Private Sub MainPage_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
        gcSpreadSheet1.Sheets(0).SetActiveCell(5, 5)      
    End Sub

    Private Sub Button_Click_1(sender As Object, e As RoutedEventArgs)
        ListBox1.Items.Add(gcSpreadSheet1.Sheets(0).ActiveCell().ToString())
        ListBox1.Items.Add(gcSpreadSheet1.Sheets(0).ActiveColumn.ToString())
        ListBox1.Items.Add(gcSpreadSheet1.Sheets(0).ActiveColumnIndex)
        ListBox1.Items.Add(gcSpreadSheet1.Sheets(0).ActiveRow.ToString())
        ListBox1.Items.Add(gcSpreadSheet1.Sheets(0).ActiveRowIndex)
    End Sub
    
    Private Sub gcSpreadSheet1_EnterCell(sender As Object, e As GrapeCity.Xaml.SpreadSheet.UI.EnterCellEventArgs) Handles gcSpreadSheet1.EnterCell
        ListBox1.Items.Add(e.Column.ToString())
        ListBox1.Items.Add(e.Row.ToString())
    End Sub

    Private Sub gcSpreadSheet1_LeaveCell(sender As Object, e As GrapeCity.Xaml.SpreadSheet.UI.LeaveCellEventArgs) Handles gcSpreadSheet1.LeaveCell
        ListBox1.Items.Add(e.Column.ToString())
        ListBox1.Items.Add(e.Row.ToString())
    End Sub
Requirements

Target Platforms: Windows Server 2012, Windows RT

See Also

Reference

Worksheet Class
Worksheet Members

 

 


Copyright © GrapeCity, inc. All rights reserved.

Support Options