Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
215
XamDataGrid -ObservableCollection not getting reflect on View
posted

I have two XamDataGrid on my user control(CustomView), I have bind this view with my CustomViewmodel which is inherited from viewmodelbase which is inherited by INotifyPropertyChanged .

On View I have two grid , grid1 have the employee data and in grid 2 will have updated data whatever user change in grid1 should be display that updated Row in it.

I bind a ObservableCollection of employee class to Grid1. Now when ever user update anything in grid1 it will call a Updated method of grid through Trigger in viewmodel and I add that row into another UpdateCollection of ObservableCollection type which is binding to grid2.

The above funtinality working properly and UpdatedCollection also get refreshed with updated record but same collection UpdateCollection  is not getting reflect in Grid2.

I need your help on this Thanks in advance.

View Code:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

<TextBlock Grid.Row="0" Grid.Column="0"> Custom Deal</TextBlock

>

 

 

 

 

<igDP:XamDataGrid Grid.Row="0" Grid.Column="0" GroupByAreaLocation="None" ScrollingMode="Deferred"

 

 

 

AutoFit="True"

 

 

 

DataSource="{Binding}" DataContext="{Binding Path=UpdatedCustomDeal}" HorizontalAlignment="Stretch" x:Name="xamDataGrid2" VerticalAlignment="Stretch" BorderBrush

="Black"

 

 

 

Theme="RoyaleStrong" BorderThickness="1" Margin

="10,30,10,10" >

 

 

 

 

<igDP:XamDataGrid.FieldLayoutSettings

>

 

 

 

 

<igDP:FieldLayoutSettings HighlightAlternateRecords="True" AutoGenerateFields="True" AllowAddNew="False" ></igDP:FieldLayoutSettings

>

 

 

 

 

</igDP:XamDataGrid.FieldLayoutSettings

>

 

 

 

 

<igDP:XamDataGrid.FieldSettings

>

 

 

 

 

<igDP:FieldSettings AllowGroupBy="False" AllowRecordFiltering="True"></igDP:FieldSettings

>

 

 

 

 

</igDP:XamDataGrid.FieldSettings

>

 

 

 

 

</igDP:XamDataGrid

>

 

 

 

 

 

<igDP:XamDataGrid Grid.Row="1" Grid.Column="0" GroupByAreaLocation="None" ScrollingMode="Deferred"

 

 

 

AutoFit="True" DataSource="{Binding}" DataContext="{Binding Path=CustomDeal}" HorizontalAlignment="Stretch" x:Name="xamDataGrid1" VerticalAlignment="Stretch" BorderBrush

="Black"

 

 

 

Theme="RoyaleStrong" BorderThickness="1" Margin

="10,30,10,10" >

 

 

 

 

<igDP:XamDataGrid.FieldLayoutSettings

>

 

 

 

 

<igDP:FieldLayoutSettings HighlightAlternateRecords="True" AutoGenerateFields="True" AllowAddNew="False" ></igDP:FieldLayoutSettings

>

 

 

 

 

</igDP:XamDataGrid.FieldLayoutSettings

>

 

 

 

 

<igDP:XamDataGrid.FieldSettings

>

 

 

 

 

<igDP:FieldSettings AllowGroupBy="False" AllowRecordFiltering="True"></igDP:FieldSettings

>

 

 

 

 

</igDP:XamDataGrid.FieldSettings

>

 

 

 

 

<i:Interaction.Triggers

>

 

 

 

 

<i:EventTrigger EventName="CellUpdated" SourceName

="xamDataGrid1">

 

 

 

 

<ei:CallMethodAction MethodName="xamDataGridCellUpdated"

 

 

 

TargetObject="{StaticResource CustomDealViewModel

}"/>

 

 

 

 

</i:EventTrigger

>

 

 

 

 

<i:EventTrigger EventName="CellUpdating" SourceName

="xamDataGrid1">

 

 

 

 

<ei:CallMethodAction MethodName="xamDataGridCellUpdating"

 

 

 

TargetObject="{StaticResource CustomDealViewModel}"

 

 

 

/>

 

 

 

 

<!--TargetObject="{Binding ElementName=LeverageFramework.ViewModel.CustomDealViewModel}"

MethodName="clickme"/>-->

 

 

 

 

</i:EventTrigger

>

 

 

 

 

</i:Interaction.Triggers

>

 

 

 

 

</igDP:XamDataGrid

>