Hi,
I want to show different grids based on business criteria with different columns.
The idea is to have a separate UserControl with a grid and in parent page change it(by hiding/showing ).
I tried embedding the grid in user control with no data context, so it inherit parent's, but nothing shows up when doing a normal binding in user control - this works fine if I have it in parent page :
<XamDataGrid Name="test" ActiveDataItem="{Binding SelectedItem}">
<Field x:Name="txt_ID" Name="Id" Label="ID"> <Field.Settings> <FieldSettings AllowEdit="False" > </FieldSettings> </Field.Settings></Field>
</XamDataGrid>
Hello and thank you for contacting Infragistics. As long as the DataContext of the Window that has the usercontrol is set you can bind to the grid. Also the datasource property of the XamDataGrid needs to be set. I attached a sample binding a grid placed in a user control where the DataSource is a view model with a list not created directly in the usercontrol's code behind but the main window's code behind. Let me know if you have any questions. WpfApp6.zip