I have a XamDataGrid to which I bind a collection which has list of it's child elements and son on. Everything works fine except column alignment shifts for child rows (please refer below screenshot) because of expansion editor symbol. How to align field alignments for for second column onward.
Thanks,
Priya
Hi Priya,
Thank you for your feedback. I am glad that you have managed to resolve your issue.
Hello Yanko,
I have finally resolved it. Thank you for you help.
Regards,
Hello Priya,
I am just checking if you require any further assistance on the matter.
Thank you for your reply. I have been looking into it and I believe that the style for the ‘ExpansionIndicator’ is not applied in your application since in Krasimir’s application everything is applied as expected. I tested your style on my side and it is applied as expected, too. I am attaching a sample application(xamDataGrid-ExpandIndicator.zip) that shows that.
It seems that you are missing something in your application.
Let me know, if you need any further assistance on this matter.
I added below code:
<Grid.Resources> --><!--<local:MarginConverter x:Key="MarginConverter"/> <Style TargetType="{x:Type igDP:DataRecordPresenter}" BasedOn="{x:Null}"> <Setter Property="Margin" Value="{Binding RelativeSource={RelativeSource Self}, Path=DataRecord.NestingDepth, Converter={StaticResource MarginConverter}}"/> </Style>--><!-- <Style TargetType="{x:Type igWindows:ExpansionIndicator}"> <Setter Property="Background"> <Setter.Value> <LinearGradientBrush EndPoint="1,1" StartPoint="0,0"> <GradientStop Color="sc#1, 0.57900393, 0.57900393, 0.57900393" Offset="1"/> <GradientStop Color="Wheat" Offset="0.36153846153846259"/> </LinearGradientBrush> </Setter.Value> </Setter> <Setter Property="BorderBrush" Value="#FF999999"/> <Setter Property="Foreground" Value="Black"/> <Setter Property="Cursor" Value="Hand"/> <Setter Property="ClipToBounds" Value="False"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type igWindows:ExpansionIndicator}"> <Grid Background="Transparent"> <Grid x:Name="grdExpansionIndicatorClosed" Height="9" RenderTransformOrigin="0.5,0.5" SnapsToDevicePixels="True" Width="9"> <Grid.ColumnDefinitions> <ColumnDefinition/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition/> </Grid.RowDefinitions> <Border x:Name="outerBorder" Background="{TemplateBinding BorderBrush}" CornerRadius="2" RenderTransformOrigin="0.5,0.5"/> <Border x:Name="innerFill" Background="{TemplateBinding Background}" CornerRadius="1.5" Height="Auto" Margin="1" RenderTransformOrigin="0.5,0.5" Width="Auto"/> <Rectangle x:Name="plusHorizontal" Fill="{TemplateBinding Foreground}" HorizontalAlignment="Stretch" Height="1" Margin="2,4" RenderTransformOrigin="0.5,0.5" VerticalAlignment="Stretch" Width="Auto"/> <Rectangle x:Name="plusVert" Fill="{TemplateBinding Foreground}" Height="Auto" Margin="4,2" RenderTransformOrigin="0.5,0.5" Width="1"/> </Grid> </Grid> <ControlTemplate.Triggers> <MultiTrigger> <MultiTrigger.Conditions> <Condition Property="IsChecked" Value="True"/> </MultiTrigger.Conditions> <Setter Property="Visibility" TargetName="plusVert" Value="Collapsed"/> </MultiTrigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style> </Grid.Resources>
It still does not indent expansion indicators. Is there anything else I am supposed to do.
Surprisingly solution provided by Krasimir works as expected. But in my code it does not get reflected.
The only difference is the datasource we are binding. I am binding nested collection to my Xamdatagrid. Is there something I am missing?