Hi, by default each level of grouping is indented, so if I group by two fields I got something like this:
How can I get rid of this indentation (restyling or setting the properties)? I want the grid to look more like this:
Thanks!
Hello,
I believe there is not direct way of suppressing this indentation, but you can create a style for the GroupByRecordPresenter and create a converter for its RenderTransform (TranslateTransform) bound to its NestingDepth property. For example :
<Style TargetType="{x:Type igDP:GroupByRecordPresenter}">
<Setter Property="RenderTransformOrigin" Value="0.5,0.5" />
<Setter Property="RenderTransform" Value="{Binding Path=NestingDepth, Converter={StaticResource conv}}" />
</Style>
where the converter looks like :
public class TranslateTransformConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
if (value == null)
return Binding.DoNothing;
else
int depth = (int)value;
return new TranslateTransform(-(depth * 17), 0);
}
This works well for the groupings, but I did a TranslateTransform (-17) on the actual rows and the headers and I ended up with rows and headers that don't go all the way to the right side of the grid. How can I make headers and rows that start at the left side and go all the way to the right in a group by grid. Is there a way to trick the headers and rows into thinking they have more space? Or is there a template change that would work?
OK, the problem really seems to be that the LabelPresenter at the end gets a clip as it moves to the edge. How can we stop that?
Thanks.
a
We were able to expand the data records by adding a negative margin (Margin="0,0,-46,0" -- details below). But we're still having problems with getting the header row to span the whole width:
It looks to us like the VirtualizingDataRecordCellPanel needs to show more labels, but we don't know how to make that happen. The widths don't cut off, it looks like the items or displayable items list is just too short:
How do we get the panel to show more elements?
FYI: Negative margin on DataRecordPresenter allows TranslateTransform row to span entire width:
<ControlTemplate TargetType="{x:Type igDP:DataRecordPresenter}"> <igWindows:CardPanel x:Name="baseGrid" Background="{TemplateBinding Background}"> <Border Visibility="Collapsed" Background="{DynamicResource {ComponentResourceKey {x:Type igDP:XamDataGrid}, AddRowBackground}}" BorderBrush="#FFA9A9A9" HorizontalAlignment="Stretch" x:Name="addRowFooter" VerticalAlignment="Stretch" Width="Auto" Height="Auto" BorderThickness="0,0,0,1"/> <!-- Unindent - added -46 margin offset to comp for translate --> <Grid Margin="0,0,-46,0"> <Grid.ColumnDefinitions>