I have created the class DisplayTable
, which was mentioned below.
I have also created one list to add the contents of the class to the list.
I pushe
for binding, always use public properties
.
change DisplayTable.cs to
public class DisplayTable
{
public int AnalyteId { get; set; }
public int UnitCode { get; set; }
public int ReferenceValue { get; set; }
}
DataGrid generates columns automatically only for properties, because each column creates a binding and WPF bindings require properties. DisplayTable
class declares fields.
instead of
public int AnalyteId;
make
public int AnalyteId { get; set; }
and fix other data members in the same way