Question

I have a XamDataGrid, which I'm trying to bind to a BindingList collection object.

When I set AutoGenerateColumns to true,

it shows all the rows and columns,

but when I set it to false and define columns using Field or UnboundField, It just shows blank rows.

I'm sure, I'm binidng each column to the correct field name inside the BindingList object.

I'm using WPF MVVM architecture!

Wondering, if someone faced simillar issue before?

Was it helpful?

Solution

Make sure that objects in your binding list have public properties with getters.

eg.

private string name;

public string Name
{
   get { return name; }
}

If you are updating the objects make sure you implement INotifyPropertyChanged and fire the event in your setters.

Also I would recommend using ObservableCollection<T> instead.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top