DataGrid의 그룹 헤더에서 열별로 몇 가지 추가 정보를보고 싶습니다. 헤더는 Stackpanel과 그 안에 몇 개의 하위 Stackpanels로 구성됩니다.DataGrid 그룹 헤더의 바인딩
<ControlTemplate TargetType="{x:Type GroupItem}">
<Expander IsExpanded="False">
<Expander.Header>
<StackPanel Orientation="Horizontal">
<StackPanel
Orientation="Horizontal"
Width="{Binding Source={x:Reference TextCol01}, Path=ActualWidth}" >
<TextBlock Text="{Binding Path=Name}" />
<TextBlock Text=" ("/>
<TextBlock Text="{Binding Path=ItemCount}" FontSize="13" FontWeight="Bold"/>
<TextBlock Text=")"/>
</StackPanel>
<StackPanel
Orientation="Horizontal">
<TextBlock Text="{Binding Path=Name}" />
<TextBlock Text=" ("/>
<TextBlock Text="{Binding Path=ItemCount}" FontSize="13" FontWeight="Bold"/>
<TextBlock Text=")"/>
</StackPanel>
</StackPanel>
</Expander.Header>
<ItemsPresenter />
</Expander>
</ControlTemplate>
: 사용자 I는 해당 열의 폭에 폭 결합 당 하나의 헤더 부분의 크기를 조정할 수있는 데이터 그리드의 칼럼의 크기를 조절할 수 있다는 사실에 기인 Width (Width = "{Binding Source = {x : Reference TextCol01}, Path = ActualWidth}")를 바인딩하지 않으면 CollectionViewGroup의 Name과 ItemCount에 대한 바인딩이 완벽하게 작동합니다. 그러나 너비를 바인딩하면 실패합니다.
바인딩 소스와 관련 있다고 가정합니다. 문맥이 바뀌면 그러나 나는 그것이 정확히 무엇이 잘못되었는지 알지 못합니다.
아무도 도와 줄 수 있습니까? 고맙습니다!
이상하게 들리지만, 내가 생각할 수있는 유일한 이유는 TextCol01이로드되어 있지 않고 다른 바인딩이 어떻게 든 폴링되지 않는다는 것입니다. – jimmyjambles
@jimmyjambles 모든 데이터가로드 된 후 데이터 집합을 그룹화하는 메서드를 호출하고 있습니다. 그래서 나는 그것이 문제가 될 수 없다고 생각합니다. – manton