Hello,
I have a user control which has a xamdatagrid. This user control is placed inside a view. The xamdatagrid is binded to a property of the view model of the view. Now as the view model propery changes, the data shown in the xamdatagrid should also change.
Since the data is dynamic and will vary based on the property of the view model, I cannot have the field layout setting in the XAML. I need to have the layout setting in the code behind which will change based on the property value.
Here is my code for the grid which is binded to the parent view model property.
<
Infragistics:XamDataGrid Grid.Row="1" Grid.ColumnSpan="2" AutoFit="False" Name="ux_grdFees" Theme="Aero" IsGroupByAreaExpanded="False" GroupByAreaLocation="AboveDataArea" DataSource="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Maintenance:MaintenanceView}},Path=DataContext.Fees, Converter={StaticResource commonFeeConverter}}" FieldLayoutInitializing="ux_grdFees_FieldLayoutInitializing" >
I am changing the field layout setting in the FieldLayoutInitializing event which is called whenever the data source property in the parent view model is changed. However, my grid is not showing the layout changes and is not binding to the data.
When I tried the same thing with field layout set in XAML, it worked fine. So, it should not be a problem with the data source.
Anyone has any idea how to approach this problem?
Thanks
Pallavi
Hello Pallavi,
I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.
If the above suggestion helped you solve your issue please verify the thread as answered so other users may take better advantage of it.
Thank you for your post. I have been looking through it and I suggest you see this forum thread:
http://forums.infragistics.com/forums/t/57569.aspx
which discusses the same issue as yours. Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.