Grid Line style

Hi,
How can i change the grid line style for sfTreeGrid . For example i wanted to change vertical grid lines to doted lnes
Thanks & Regards
Siju.P.Sukumar

1 Reply

JG Jai Ganesh S Syncfusion Team July 4, 2017 01:21 PM UTC

Hi Siju, 
You can achieve your requirement for showing a dotted line in SfTreeGrid by writing the style of SfTreeGridCell like below, 
<Style TargetType="syncfusion:TreeGridCell"> 
                <Setter Property="Background" Value="Transparent" /> 
                <Setter Property="BorderThickness" Value="0"/> 
                <Setter Property="Padding" Value="0" /> 
                <Setter Property="Template"> 
                    <Setter.Value> 
                        <ControlTemplate TargetType="syncfusion:TreeGridCell"> 
                            <Grid x:Name="Root" 
                          Background="{TemplateBinding Background}" 
                          BorderBrush="{TemplateBinding BorderBrush}" 
                          BorderThickness="{TemplateBinding BorderThickness}"> 
                                <VisualStateManager.VisualStateGroups> 
                                    <VisualStateGroup x:Name="IndicationStates"> 
                                        <VisualState x:Name="NoError" /> 
                                        <VisualState x:Name="HasError"> 
                                            <VisualState.Setters> 
                                                <Setter Target="PART_InValidCellBorder.Visibility" Value="Visible" /> 
                                            </VisualState.Setters> 
                                        </VisualState> 
                                    </VisualStateGroup> 
 
                                    <VisualStateGroup x:Name="CurrentStates"> 
                                        <VisualState x:Name="Regular" /> 
                                        <VisualState x:Name="Current"> 
                                            <VisualState.Setters> 
                                                <Setter Target="PART_CurrentCellBorder.Visibility" Value="Visible" /> 
                                            </VisualState.Setters> 
                                        </VisualState> 
                                    </VisualStateGroup> 
                                </VisualStateManager.VisualStateGroups> 
                       
                                 
                                <Rectangle  Stroke="Red" StrokeThickness="1" 
                                            StrokeDashArray="4 2"   
                                            VerticalAlignment="Stretch"  
                                            HorizontalAlignment="Stretch"> 
                                </Rectangle> 
                                <ContentPresenter /> 
 
                                <Border x:Name="PART_CurrentCellBorder" 
                                Background="Transparent" 
                                BorderBrush="{TemplateBinding CurrentCellBorderBrush}" 
                                BorderThickness="{TemplateBinding CurrentCellBorderThickness}" 
                                IsHitTestVisible="False" 
                                Visibility="Collapsed" /> 
                                <Border x:Name="PART_InValidCellBorder" 
                                Width="10" 
                                Height="10" 
                                HorizontalAlignment="Right" 
                                VerticalAlignment="Top" 
                                Visibility="Collapsed"> 
                                    <ToolTipService.ToolTip> 
 
                                        <ToolTip Background="#FFDB000C" 
                                         Placement="Right" 
                                         Tag="{TemplateBinding ErrorMessage}" 
                                         Template="{StaticResource ValidationToolTipTemplate}" /> 
 
                                    </ToolTipService.ToolTip> 
                                    <Path Data="M0.5,0.5 L12.652698,0.5 12.652698,12.068006 z" 
                                  Fill="Red" 
                                  Stretch="Fill" /> 
                                </Border> 
                            </Grid> 
                        </ControlTemplate> 
                    </Setter.Value> 
                </Setter> 
 
            </Style> 
  
Regards, 
Jai Ganesh S 


Loader.
Up arrow icon