We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

SfDataGrid GroupDataArea WatermarkTextVisibility setting ignored after first grouping

<Style TargetType="syncfusion:GroupDropArea">
        <Setter Property="WatermarkTextVisibility" Value="Collapsed"/>
</Style>
I have set WatermarkTextVisibility to collapsed which works until the first time I drag-drop a column into the grouping area. Soon after the watermark text appears and will not go away. How can I make it remain collapsed all the time?I am using v13.3.0.12

3 Replies

GM Gobikrishnan Murugesan Syncfusion Team December 12, 2016 06:59 AM UTC

Hi Somanna, 
 
Thank you for contact Syncfusion support. 
 
We have analyzed your query. You can achieve you requirement by edit GroupDropAreaStyle of SfDataGrid. Please find the code snippet below, 
 
 
        <Style x:Key="GroupDropAreaStyle1" TargetType="{x:Type syncfusion:GroupDropArea}"> 
            <Setter Property="Background" Value="White"/> 
            <Setter Property="Foreground" Value="Gray"/> 
            <Setter Property="BorderBrush" Value="Gray"/> 
            <Setter Property="BorderThickness" Value="1,1,1,0"/> 
            <Setter Property="Focusable" Value="False"/> 
            <Setter Property="IsTabStop" Value="False"/> 
            <Setter Property="Template"> 
                <Setter.Value> 
                    <ControlTemplate TargetType="{x:Type syncfusion:GroupDropArea}"> 
                        <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="True"> 
                            <VisualStateManager.VisualStateGroups> 
                                <VisualStateGroup x:Name="ExpansionStates"> 
                                    <VisualStateGroup.Transitions> 
                                        <VisualTransition From="{x:Null}" GeneratedDuration="0" GeneratedEasingFunction="{x:Null}" Storyboard="{x:Null}" To="{x:Null}"/> 
                                    </VisualStateGroup.Transitions> 
                                    <VisualState x:Name="Collapsed"> 
                                        <Storyboard> 
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Margin)" Storyboard.TargetName="PART_GroupDropAreaBorder"> 
                                                <DiscreteObjectKeyFrame KeyTime="0"> 
                                                    <DiscreteObjectKeyFrame.Value> 
                                                        <Thickness>0</Thickness> 
                                                    </DiscreteObjectKeyFrame.Value> 
                                                </DiscreteObjectKeyFrame> 
                                            </ObjectAnimationUsingKeyFrames> 
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="PART_GroupDropAreaBorder"> 
                                                <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0"> 
                                                    <EasingDoubleKeyFrame.EasingFunction> 
                                                        <CircleEase/> 
                                                    </EasingDoubleKeyFrame.EasingFunction> 
                                                </EasingDoubleKeyFrame> 
                                            </DoubleAnimationUsingKeyFrames> 
                                        </Storyboard> 
                                    </VisualState> 
                                    <VisualState x:Name="Expanded"> 
                                        <Storyboard> 
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Margin)" Storyboard.TargetName="PART_GroupDropAreaBorder"> 
                                                <DiscreteObjectKeyFrame KeyTime="0"> 
                                                    <DiscreteObjectKeyFrame.Value> 
                                                        <Thickness>0,0,0,20</Thickness> 
                                                    </DiscreteObjectKeyFrame.Value> 
                                                </DiscreteObjectKeyFrame> 
                                            </ObjectAnimationUsingKeyFrames> 
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="PART_GroupDropAreaBorder"> 
                                                <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="28"> 
                                                    <EasingDoubleKeyFrame.EasingFunction> 
                                                        <CircleEase/> 
                                                    </EasingDoubleKeyFrame.EasingFunction> 
                                                </EasingDoubleKeyFrame> 
                                            </DoubleAnimationUsingKeyFrames> 
                                        </Storyboard> 
                                    </VisualState> 
                                </VisualStateGroup> 
                            </VisualStateManager.VisualStateGroups> 
                            <Grid Background="{TemplateBinding Background}"> 
                                <Grid.ColumnDefinitions> 
                                    <ColumnDefinition x:Name="cd0" Width="*"/> 
                                    <ColumnDefinition x:Name="cd1" Width="Auto"/> 
                                </Grid.ColumnDefinitions> 
                                <Grid.RowDefinitions> 
                                    <RowDefinition x:Name="rd0" Height="Auto"/> 
                                    <RowDefinition x:Name="rd1" Height="*"/> 
                                </Grid.RowDefinitions> 
                                <ToggleButton Background="Transparent" Grid.Column="1" Height="12" IsTabStop="False" IsThreeState="False" IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Margin="2" Grid.Row="0" SnapsToDevicePixels="True" Width="45"> 
                                    <ToggleButton.Style> 
                                        <Style TargetType="{x:Type ToggleButton}"> 
                                            <Setter Property="Background" Value="Transparent"/> 
                                            <Setter Property="Template"> 
                                                <Setter.Value> 
                                                    <ControlTemplate TargetType="{x:Type ToggleButton}"> 
                                                        <Grid Background="{TemplateBinding Background}"> 
                                                            <Path Data="M31.460022,0C34.221447,-4.8935362E-08 36.460022,2.2385764 36.460022,5 36.460022,7.7614241 34.221447,10 31.460022,10 28.698599,10 26.460022,7.7614241 26.460022,5 26.460022,2.2385764 28.698599,-4.8935362E-08 31.460022,0z M18.208984,0C20.970407,-4.8935362E-08 23.208984,2.2385764 23.208984,5 23.208984,7.7614241 20.970407,10 18.208984,10 15.44756,10 13.208984,7.7614241 13.208984,5 13.208984,2.2385764 15.44756,-4.8935362E-08 18.208984,0z M5,0C7.7614241,-4.8935362E-08 10,2.2385764 10,5 10,7.7614241 7.7614241,10 5,10 2.2385764,10 0,7.7614241 0,5 0,2.2385764 2.2385764,-4.8935362E-08 5,0z" Fill="Gray" Stretch="Uniform" SnapsToDevicePixels="True" UseLayoutRounding="False"/> 
                                                        </Grid> 
                                                    </ControlTemplate> 
                                                </Setter.Value> 
                                            </Setter> 
                                        </Style> 
                                    </ToggleButton.Style> 
                                </ToggleButton> 
                                <Border x:Name="PART_GroupDropAreaBorder" Grid.ColumnSpan="1" Grid.Column="0" Height="0" Grid.Row="1" SnapsToDevicePixels="True"> 
                                    <Grid x:Name="PART_GroupDropAreaGrid" MaxHeight="30" Margin="40,0,0,0"> 
                                        <Grid HorizontalAlignment="Center" Opacity="0.5" Visibility="Collapsed" VerticalAlignment="Stretch"> 
                                            <Rectangle RadiusY="5" RadiusX="5" SnapsToDevicePixels="True" Stroke="{TemplateBinding Foreground}" StrokeThickness="1" StrokeDashArray="5 5"/> 
                                            <TextBlock Foreground="{TemplateBinding Foreground}" FontSize="14" HorizontalAlignment="Center" Margin="40,5" Text="{TemplateBinding GroupDropAreaText}" VerticalAlignment="Center"/> 
                                        </Grid> 
                                        <StackPanel x:Name="PART_StackPanel" MaxHeight="30" Orientation="Horizontal"/> 
                                    </Grid> 
                                </Border> 
                            </Grid> 
                        </Border> 
                    </ControlTemplate> 
                </Setter.Value> 
            </Setter> 
        </Style> 
 
 
Please let us know if you have any query. 
 
Regards, 
Gobikrishnan 



SC Somanna Chottekalapanda December 13, 2016 10:46 AM UTC

Thanks Gobikrishnan. I will give it a try.
However, I don't see "WatermarkTextVisibility" value used anywhere in that style but it works until the first drag drop. We could bind the visibility to WatermarkTextVisibility value instead of setting it to collapsed?


BR Balamurugan Rajaraman Syncfusion Team December 14, 2016 01:52 PM UTC

Hi Somanna, 
We have analyzed your query “SfDataGrid GroupDataArea WatermarkTextVisibility setting ignored after first grouping”. We have suggested you to use the Visibility=” Collapsed” property instead of set the waterMarkvisibility. This will manage the watermarkvisibility in the collapsed state internally. when Group or ungroup the Column operation. This will satisfy your suggestion. We have attached the tested sample for your reference please find the sample from the below mentioned link. 
Sample Link: 
 

Regards, 
Balamurugan 


Loader.
Up arrow icon