컬렉션에 새 항목을 추가하면 Silverlight의 Telerik Radgridview에 표시 될 때 기존 정렬을 존중하지 않습니다.

StackOverflow https://stackoverflow.com/questions/6050142

문제

i ViewModel의 컬렉션에 바인딩 된 내 양식에 RadGridView 컨트롤이 있습니다.내 컬렉션에 새 항목을 추가하면 눈금에 항목이 표시되지만 항상 현재 정렬을 존중하지 않고 항상 배치됩니다.아무도이 문제를 해결하는 방법을 알고 있습니까?

감사합니다!

도움이 되었습니까?

해결책

If using a ObservableCollection solves your problem when a new item is added you could use the CellEditEnded event to reset the sorting on the grid.

You can subscribe to the event in code or the xaml; take a look at CellEditEnded documentation. In the handler you could then unset the sorting and then set it again.

I have not tried this with the telerik components only with a WPF DataGrid.

다른 팁

Not sure what issue you are running into, but I threw together a quick proof of concept and everything seemed to work as expected. Check out the download available here:

Quick grid demo

and let me know how it differs from your setup. I sorted by ID, then when adding new items the new items populate into the sorted collection as expected since they are made with a random ID that falls inside of the original range. Perhaps you aren't using an ObservableCollection or *CollectionView?

-Evan

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