I created a fieldlayout in the backend and I am trying to display it in a XamDataGrid, but the fields I created won't display. As a matter of fact, nothing appears on the grid. What seems to be my problem?
Here is my xaml code:
Title="MainWindow" Height="350" Width="525" xmlns:igWPF="">schemas.infragistics.com/.../wpf">
<DockPanel LastChildFill="True" Margin="0,26,0,-26">
and the backend:
private void ShowAccountInfoGrid()
ComboBoxItemsProvider title_provider = new ComboBoxItemsProvider();
ComboBoxItemsProvider code_provider = new ComboBoxItemsProvider();
List<Acc_LinkDTO> Acc_lists = new List<Acc_LinkDTO>();
Acc_lists = _Acc_LinkUIAdapter.getAllAcc_Links().ToList();
accounts = _AccountUIAdapter.getALlGroup();
foreach (var x in Acc_lists)
int i = 0;
title_provider.Items.Add(new ComboBoxDataItem(i, x.Acc_LinkTitle));
foreach (var x in accounts)
int i = 0;
code_provider.Items.Add(new ComboBoxDataItem(i, x.Code2));
name_provider.Items.Add(new ComboBoxDataItem(i, x.Name));
Field fld1 = new Field();
fld1.Name = "Account Title";
Style style1 = new Style(typeof(XamComboEditor));
style1.Setters.Add(new Setter(XamComboEditor.ItemsProviderProperty, title_provider));
fld1.Settings.EditorStyle = style1;
fld1.Settings.EditorType = typeof(XamComboEditor);
I have been investigating into the behavior you are looking to achieve, and most of the code that you provided looks good in this case, but it appears to be missing a DataSource setting for the XamDataGrid. This is what will generate the records for the grid, and the Name properties of the Field need to match up to a property on your underlying data item in the IEnumerable set to the DataSource of the grid, otherwise your FieldLayout will not be used.
You can read further about generation of FieldLayouts in the XamDataGrid by using this online documentation article.
Please let me know if you have any other questions or concerns on this matter.