トップ回答者
DataGrid グループ化時の行頭の空白について

質問
回答
-
例というのはhttp://msdn.microsoft.com/ja-jp/library/ff407126%28v=vs.110%29.aspxのサンプルのことでしょうか?
とりあえずGroupStyleをちょっと変えてみて消してみる
<!-- Style for groups at top level. --> <GroupStyle> <GroupStyle.ContainerStyle> <Style TargetType="{x:Type GroupItem}"> <Setter Property="Margin" Value="0,0,0,5"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type GroupItem}"> <Expander IsExpanded="True" Background="#FF112255" BorderBrush="#FF002255" Foreground="#FFEEEEEE" BorderThickness="1,1,1,5"> <Expander.Header> <DockPanel> <TextBlock FontWeight="Bold" Text="{Binding Path=Name}" Margin="5,0,0,0" Width="100"/> <TextBlock FontWeight="Bold" Text="{Binding Path=ItemCount}"/> </DockPanel> </Expander.Header> <Expander.Content> <!-- このItemsPresenterで行が表示される --> <!-- この内側でMarginが設定されていて右に寄ってるらしい--> <!-- とりあえずマイナスマージンを設定して打ち消してみる--> <ItemsPresenter Margin="-5,0,0,0" /> </Expander.Content> </Expander> </ControlTemplate> </Setter.Value> </Setter> </Style> </GroupStyle.ContainerStyle> </GroupStyle>
個別に明示されていない限りgekkaがフォーラムに投稿したコードにはフォーラム使用条件に基づき「MICROSOFT LIMITED PUBLIC LICENSE」が適用されます。(かなり自由に使ってOK!)
- 回答としてマーク eru.tndl 2014年6月19日 1:30
すべての返信
-
例というのはhttp://msdn.microsoft.com/ja-jp/library/ff407126%28v=vs.110%29.aspxのサンプルのことでしょうか?
とりあえずGroupStyleをちょっと変えてみて消してみる
<!-- Style for groups at top level. --> <GroupStyle> <GroupStyle.ContainerStyle> <Style TargetType="{x:Type GroupItem}"> <Setter Property="Margin" Value="0,0,0,5"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type GroupItem}"> <Expander IsExpanded="True" Background="#FF112255" BorderBrush="#FF002255" Foreground="#FFEEEEEE" BorderThickness="1,1,1,5"> <Expander.Header> <DockPanel> <TextBlock FontWeight="Bold" Text="{Binding Path=Name}" Margin="5,0,0,0" Width="100"/> <TextBlock FontWeight="Bold" Text="{Binding Path=ItemCount}"/> </DockPanel> </Expander.Header> <Expander.Content> <!-- このItemsPresenterで行が表示される --> <!-- この内側でMarginが設定されていて右に寄ってるらしい--> <!-- とりあえずマイナスマージンを設定して打ち消してみる--> <ItemsPresenter Margin="-5,0,0,0" /> </Expander.Content> </Expander> </ControlTemplate> </Setter.Value> </Setter> </Style> </GroupStyle.ContainerStyle> </GroupStyle>
個別に明示されていない限りgekkaがフォーラムに投稿したコードにはフォーラム使用条件に基づき「MICROSOFT LIMITED PUBLIC LICENSE」が適用されます。(かなり自由に使ってOK!)
- 回答としてマーク eru.tndl 2014年6月19日 1:30