DevExpress/DX_WPF

[DX_WPF] CellTemplateSelector

딸기우유중독 2025. 2. 19. 13:25

 

 

View.xaml 

 

Resource Dictionary 등록

 

Resource Dictionary의 x:Key 값이 "ValueEditorTemplateSelector" 인거 사용

 


 

 

ValueEditorTemplateSelector.xaml

 

 

ValueEditorTemplateSelector.cs

 

RowData.Row 를 해당하는 데이터 타입으로 변환(ex ITagData) 해서

 

RowData.Row.(필드이름=ITagData의 프로퍼티) 를

TryFindResource로 (  View.xaml + Resource Dictionary) 에서 찾아서(x:key = dataItem.Type) 있으면

(DataTemplate)으로 반환, 없으면 null 반환.

 

 

 

 

 


 

 

 

 

https://docs.devexpress.com/WPF/DevExpress.Xpf.Grid.ColumnBase.CellTemplateSelector

 

ColumnBase.CellTemplateSelector Property | WPF Controls | DevExpress Documentation

ColumnBase.CellTemplateSelector Property Gets or sets an object that chooses a cell template based on custom logic. This is a dependency property. Namespace: DevExpress.Xpf.Grid Assembly: DevExpress.Xpf.Grid.v24.2.Core.dll NuGet Package: DevExpress.Wpf.Gri

docs.devexpress.com

 

 

728x90