0
새로운 WPF 프로젝트와 xaml은 정말 혼란 스럽습니다.C# XAML grid Expander
그룹화 된 ListCollectionView를 표시하는 DataGrid가 있는데 그룹화 된 뷰가 축소되도록 클릭 버튼을 갖고 싶습니다. (어쩌면 너무 쉽게?)이를 통해 도보로 하나의 예를 들어이없는 달성하기 쉬운 기능으로 보이지만 지난 날 어디서나 검색 여기
내 XAML 코드입니다<Window.Resources>
<Style x:Key="GroupHeaderStyle" TargetType = "{x:Type GroupItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupItem}">
<Expander x:Name="myExpander" IsExpanded="True"
Background="LightBlue"
Foreground="Black">
<ItemsPresenter />
</Expander>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
와의 MainWindow.xaml.cs를
ListCollectionView collection = new ListCollectionView(dt.DefaultView);
collection.GroupDescriptions.Add(new PropertyGroupDescription("Grouping"));
dataGrid1.ItemsSource = collection;
도와주세요. 대단히 감사합니다.
목록보기를 직접 확장기 컨트롤에 넣지 않는 이유는 무엇입니까 ?? – Versatile