BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
# Form1.vb
Public Sub New() InitializeComponent()
PivotGridSettings()
AddHandler pivotGridControl1.TableControl.CurrentCellStartEditing, AddressOfMe.TableControl_CurrentCellStartEditing
AddHandler pivotGridControl1.TableControl.CurrentCellEditingComplete,AddressOf Me.TableControl_CurrentCellEditingComplete
End Sub
'Occurs while edting the cells
Private Sub TableControl_CurrentCellStartEditing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs)
'Write your code here.
End Sub
'Occurs after complete the editing.
Private Sub TableControl_CurrentCellEditingComplete(ByVal sender As Object,ByVal e As EventArgs)
'Write your code here.
End Sub
|
# Form1.vb
Private Sub TableControl_CurrentCellEditingComplete(ByVal sender As Object, ByVal e As EventArgs)
‘find the row and column index of edited cell.
Dim row As Integer = Me.pivotGridControl1.TableControl.CurrentCell.RowIndex - 1
Dim column As Integer = Me.pivotGridControl1.TableControl.CurrentCell.ColIndex – 1
‘find the first row header.
Dim rowheader As String = Me.pivotGridControl1.PivotEngine(row, 0).FormattedText
‘find the first column header.
Dim columnheader As String = Me.pivotGridControl1.PivotEngine(0, column).FormattedText
‘find the cell value after editing. Dim value As Integer = Convert.ToInt32(Me.pivotGridControl1.PivotEngine(row, column).FormattedText.ToString())
‘Updates the ItemSource with new value. For Each sales As ProductSales In productSalesData
If sales.Country = columnheader AndAlso sales.Date = rowheader Then
sales.Quantity = value
End If
Next
End Sub |