GrapeCity.Xaml.SpreadSheet.UI
EnterCell Event (GcSpreadSheet)
Example 


GrapeCity.Xaml.SpreadSheet.UI Namespace > GcSpreadSheet Class : EnterCell Event
Occurs when the user enters a cell.
Syntax
'Declaration
 
Public Event EnterCell As EventHandler(Of EnterCellEventArgs)
'Usage
 
Dim instance As GcSpreadSheet
Dim handler As EventHandler(Of EnterCellEventArgs)
 
AddHandler instance.EnterCell, handler
public event EventHandler<EnterCellEventArgs> EnterCell
Event Data

The event handler receives an argument of type EnterCellEventArgs containing data related to this event. The following EnterCellEventArgs properties provide information specific to this event.

PropertyDescription
Gets the row index of the cell being entered.  
Gets the column index of the cell being entered.  
Example
This example uses the EnterCell event.
gcSpreadSheet1.Sheets[0].SetActiveCell(5, 5);

private void Button_Click_1(object sender, RoutedEventArgs e)
        {

            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());
        }
gcSpreadSheet1.Sheets(0).SetActiveCell(5, 5)

Private Sub Button_Click_1(sender As Object, e As RoutedEventArgs)        
        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
See Also