I have a GUI and DataGrid element (C#, WPF). There I have 4 columns – name, value, timestamp and comment. As a data source I use a collection of elements of type Parameter, that has properties name, value, timestamp and comment. How can I create data binding for columns in DataGrid to display the corresponding property of all Parameter elements in collection?
Share
Wel, you need to define a DataTemplate and one time it’s defined in XAML, assign to your
DataGridcontrol’sDataContextthe collection of elements you haveList<Parameter>.It’s not something that can be described in one asnwer, so worth reading of
WPF DataGrid: Using DataTemplates for auto-generated columns
It’s not difficult and pretty intuitive, till you’re doing a simple things.