C#
C# -- 정렬가능한 양방항 binding DataGridView 만들기 (SortableBindingList 와 INotifyPropertyChanged 이용)
자유프로그램
2019. 11. 28. 16:16
반응형
C# -- 정렬가능한 양방항 binding DataGridView 만들기
(SortableBindingList 와 INotifyPropertyChanged 이용)
참고 : http://martinwilley.com/net/code/forms/sortablebindinglist.html ==> SortableBindingList 출처.
** DataGridView 의 DataSource 로 BindingList 사용시에는 정렬기능 없다.
--> 이 문제를 해결한게 SortableBindingList 이다.
; BindingList 대신에 SrotableBindingList 사용하면 됨.
** DataGridView 에 연결한 DataSource 의 객체들 내부 속성에 변경사항이 생기면,
이를 즉시 DataGridView 화면에 반영하기위해서는, INotifyPropertyChanged 를 구현해야함.
--> DataGridView 화면에서 수정한 경우에도, 해당 원본 객체의 속성에 잘 반영됨.
< 실행 화면 >
< 소스코드>
--
반응형