I have created the fieldLayout. But when I use the Grid1.DataItems.Add() that doesn't seem to work with the fieldLayout that I created. How then do I add records?
I used the add collection and add field GUI interface from the properties for the grid. this is as close as the old UtlraWinGrid has to a designer I guess.
Anyway it created the XAML and that looks good.
What method is used to add data? the only one I have found is requires a collection object, which I guess is already defined... I am just not used to the WPF yet and basically lost trying to get this working.
The generated XAML is below.
Thanks for the help!
<igDP:XamDataGrid Canvas.Left="50" Canvas.Top="301" Height="136" Name="Grid1" Width="435" DataContext="{Binding}"> <igDP:XamDataGrid.FieldLayouts> <igDP:FieldLayout> <igDP:FieldLayout.FieldSettings> <igDP:FieldSettings CellClickAction="SelectRecord"/> </igDP:FieldLayout.FieldSettings> <igDP:FieldLayout.Fields> <igDP:Field Name="name" Label="Name"/> <igDP:Field Name="department" Label="Dept." /> <igDP:Field Name="salary" Label="Salary"/> <igDP:Field Name="email" Label="Email"/> </igDP:FieldLayout.Fields> </igDP:FieldLayout> </igDP:XamDataGrid.FieldLayouts> </igDP:XamDataGrid>
Hello,
Does the definition of the underlying object match the fields in this FieldLayout? Have you set AutoGenerateFields to false. The XamDataGrid by default would generate a new FieldLayout if the new object does not match the current layout.