Hello,
I have used the xamdatagrid and created some trigger event with the help of interaction Triggers.
I have written its method in view model but Its not working data binding is working proerly for grid but theres some issues in binding trigger. Please find below code snippes .
I have aslo attached the code sample which might be useful to undestand my issues.
<i:Interaction.Triggers> <i:EventTrigger EventName="CellUpdated" SourceName="xamDataGrid1"> <ei:CallMethodAction MethodName="{Binding Path= xamDataGridCellUpdated}" TargetObject="{Binding ElementName=TestViewModel}"/> </i:EventTrigger> <i:EventTrigger EventName="CellActivating" SourceName="xamDataGrid1"> <ei:CallMethodAction MethodName="{Binding Path= xamDataGridCellActivating}" TargetObject="{Binding ElementName=TestViewModel}"/> </i:EventTrigger>
</i:Interaction.Triggers>
Looking forward for your kind relay.
Can Any one help me on this?
Still I am not able to resolve it.
Looking forward for your plasure reply.
Thank you for your post. I have been looking into it and the sample project you have attached and I suggest you use the following code for the Interaction instead of yours:
<i:Interaction.Triggers> <i:EventTrigger EventName="CellUpdated" SourceName="xamDataGrid1"> <ei:CallMethodAction MethodName="xamDataGridCellUpdated" TargetObject="{StaticResource myVM}"/> </i:EventTrigger> <i:EventTrigger EventName="CellActivating" SourceName="xamDataGrid1" > <ei:CallMethodAction MethodName="xamDataGridCellActivating" TargetObject="{StaticResource myVM}"/> </i:EventTrigger> </i:Interaction.Triggers>
Also you should add this to the Resources of your XamDataGrid:
<igDP:XamDataGrid.Resources> <local:TestViewModel x:Key="myVM"/> </igDP:XamDataGrid.Resources>
And this namespace, too:
xmlns:local="clr-namespace:SpreadsheetFramework.Client.ViewModel"
Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.