문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top