I've a C#/WPF application in which I'm using WorkbookView control.I'm using Spreadsheetgear inside my app.
I've cells A and B in my worksheet.On updating value in A, I need to do some calculations and update value in cell B. The problem is that using the code below, I'm not getting the latest updated value of cell A. For e.g.let's say the current value of A is 1.User changes its value to 2 and wbvOverride_CellBeginEdit method gets invoked. In this method,am always getting value as 1 instead of the new value 2.
What am I missing here please?
Here's my code.
Thanks.
ViewModel:
public void wbvOverride_CellBeginEdit(object sender, SpreadsheetGear.Windows.Controls.CellBeginEditEventArgs e)
{
SpreadsheetGear.Windows.Controls.WorkbookView sheet = sender as SpreadsheetGear.Windows.Controls.WorkbookView;
string tempValue = sheet.ActiveCell.Worksheet.Cells[2, 7].Value'
}
XAML:
<Controls:WorkbookView x:Name="wbvOverride" HorizontalAlignment="Stretch" Margin="1" Grid.Row="2" VerticalAlignment="Stretch" ShowError="workbookView_ShowError" >
<i:Interaction.Triggers>
<i:EventTrigger EventName="CellBeginEdit">
<ei:CallMethodAction MethodName="wbvOverride_CellBeginEdit" TargetObject="{Binding}" />
</i:EventTrigger>
</i:Interaction.Triggers>
</Controls:WorkbookView>