I have static data that I want to display in Datagrid format. The values are for display purposes only and will not change. Can it be added as some kind of subtag of the Dat
Here is pure XAML static data binded on a datagrid:
Result:
I wasn't able to autogenerate columns using XmlDataProvider (I'm probably missing something):
But using a code Behind class like Dave Suggestion allow AutoBinding to work and in my opinion is much simpler (I preferred the ResourceDictionary
approach though) :
Code:
namespace WpfStaticDataBinding
{
public class MockRecord
{
public string FirstName { get; set; }
public string LastName { get; set; }
public string Email { get; set; }
}
}
XAML