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.
Unfortunately, activation email could not send to your email. Please try again.

SfDataGrid GroupDataArea WatermarkTextVisibility setting ignored after first grouping

Thread ID:

Created:

Updated:

Platform:

Replies:

127801 Dec 9,2016 07:22 AM Dec 14,2016 08:52 AM WPF 3
loading
Tags: SfDataGrid
Somanna Chottekalapanda
Asked On December 9, 2016 07:22 AM

<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

Gobikrishnan Murugesan [Syncfusion]
Replied On December 12, 2016 01:59 AM

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 


Somanna Chottekalapanda
Replied On December 13, 2016 05:46 AM

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?

Balamurugan Rajaraman [Syncfusion]
Replied On December 14, 2016 08:52 AM

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 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;