티스토리 뷰
https://stackoverflow.com/a/3708608/4394750
- null인 경우에 값을 바꾸려면 {Binding TargetNullValue='값'} 이면 충분함 (답변 1)
- (위 링크에 없음)
생판 다른 값을 바인딩해서 바꾸려면 DataGridTextColumn에 Binding을 설정하지 않고, <DataGridTextColumn.ElementStyle> 및 EditingElementStyle에서 DataTrigger로 바인딩을 넣자
잘은 모르겠는데 Text 스타일이 Binding에 의해 오버라이드되어서 값을 바꿀 수 없다고 하는 모양. WPF 디버거로 찍어봤을 때 스타일 값으로 설정한 값이 나오기는 합니다.
<DataGridTextColumn Header="내 헤더" Width="*" > // Binding 이 설정되지 않은 점에 주목 (원래대로라면 FirstValue)
<DataGridTextColumn.ElementStyle>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="Text" Value="{Binding Path=FirstValue, Mode=OneWay}" />
<Style.Triggers>
<DataTrigger Binding="{Binding Path=SecondValue}" Value="True">
<Setter Property="Text" Value="히히히히!" />
</DataTrigger>
</Style.Triggers>
</Style>
</DataGridTextColumn.ElementStyle>
<DataGridTextColumn.EditingElementStyle>
<Style TargetType="{x:Type TextBox}">
<Setter Property="Text" Value="{Binding Path=FirstValue, Mode=TwoWay}" />
</Style>
</DataGridTextColumn.EditingElementStyle>
</DataGridTextColumn>
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- C++ FAQ
- gitea
- 쿠버네티스
- 업비트
- pleroma
- 오라클 클라우드 인프라
- 왜 생각이 안 났지
- rust-lang
- c++
- 개발기록
- 토이프로젝트
- mvu
- Godot Engine
- javascript
- ArchLinuxARM
- vuex
- kotlin당했다
- 마스토돈
- OStatus
- scss
- upbit
- 시스어드민
- Sass
- C#
- exercism
- 오라클 클라우드
- Oracle Cloud Infrastructure
- ActivityPub
- K8s
- pdf.js
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
글 보관함