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

Grouping

Hello,

When i group the Grid, then in the "Groupline" stands the Label "- Items" behind the Text.
How can i translate this in other Language ?
In the Syncfusion.SfGrid.WPF.resx i can't find the Label "Items".

Greets

7 Replies

MK Muthukumar Kalyanasundaram Syncfusion Team June 2, 2017 12:11 PM UTC

Hi Greets, 
 
Thank you for contacting Syncfusion support. 
 
We have checked your query. Currently, we don’t have the support for localizing the GroupCaptionText. If you want to translate the GroupDropAreaText and GroupCaptionTextFormat text in other language , you can set the text with particular language as shown like below code, 
 
<syncfusion:SfDataGrid Margin="10" 
                    AllowFiltering="True" 
                    AllowGrouping="True" 
                    AutoGenerateColumns="False" 
                    ColumnSizer="Star" 
                    GroupCaptionTextFormat="'{ColumnName} : {Key} - {ItemsCount} Artikel'" 
                    GroupDropAreaText="Ziehen Sie eine Spaltenüberschrift Sie hier, um nach dieser Spalte Gruppe"                                  
                    IsGroupDropAreaExpanded="True" 
                    ItemsSource="{Binding OrdersDetails}" 
                    NavigationMode="Row" 
                    ShowGroupDropArea="True"> 


Please let us know if you have any query. 

Regards, 
Muthukumar K


DE Denig June 8, 2017 10:25 AM UTC

Thanks, its works fine.Can I set only this ItemsCount at the right site of the GroupLine ?When i change the Background of the CaptionSummaryRowControl the Arrow Down is not showCan i also set the Arrow Down at the right Site ?greets


MK Muthukumar Kalyanasundaram Syncfusion Team June 9, 2017 07:07 AM UTC

Hi Greets, 

Thanks for the update. 

We have analyzed your query. Please find the response from below table. 


Query 1: 
Can I set only this ItemsCount at the right site of the GroupLine ? 


You can achieve your requirement by customizing the style of “GridCaptionSummaryCell” as shown like below code, 

Code Snippet: 

<Style TargetType="syncfusion:GridCaptionSummaryCell">               
    <Setter Property="HorizontalContentAlignment" Value="Right"/> 
    <Setter Property="Padding" Value="0,0,20,0"/> 
</Style>    

 

Query 2: 
When i change the Background of the CaptionSummaryRowControl the Arrow Down is not show.  

We are unable to reproduce the reported query “When we applied background color in CaptionSummaryRowControl style” in our end. For your reference, we have attached the snapshot.  

 

If it’s possible, could you please revert by modifying the attached sample based on your application along with the replication procedure?.   This would be helpful for us to provide an appropriate solution as soon as possible.  


Query 3: 
Can i also set the Arrow Down at the right Site ? 


If you want to set the expander cell to right side of grid, you can customize the style of “CaptionSummaryRowControl”  as shown like below code, 
 
Code Snippet: 

<Style  TargetType="syncfusion:CaptionSummaryRowControl"> 
    <Setter Property="Background" Value="SkyBlue" /> 
    <Setter Property="Foreground" Value="Red" /> 
    <Setter Property="BorderBrush" Value="Gray" /> 
    <Setter Property="FontSize" Value="14" /> 
    <Setter Property="FontWeight" Value="Normal" /> 
    <Setter Property="BorderThickness" Value="0" /> 
    <Setter Property="IsTabStop" Value="False" /> 
    <Setter Property="Template"> 
        <Setter.Value> 
            <ControlTemplate TargetType="syncfusion:CaptionSummaryRowControl"> 
                <Grid SnapsToDevicePixels="True"> 
                   . . . . .  
 
                  . . . . . 
                    <Border Background="{TemplateBinding Background}" 
                        BorderBrush="{TemplateBinding BorderBrush}"  
                        BorderThickness="{TemplateBinding BorderThickness}" 
                        SnapsToDevicePixels="True"> 
                        <Grid SnapsToDevicePixels="True"> 
                            <ContentPresenter VerticalAlignment="Center"  
                                            Content="{TemplateBinding Content}" 
                                            SnapsToDevicePixels="True" /> 
                            <Grid x:Name="PART_CaptionSummaryRowGrid" IsHitTestVisible="False"> 
                                <Border x:Name="PART_CaptionSummaryRowBorder" 
                                    HorizontalAlignment="Right" 
                                    BorderBrush="{TemplateBinding BorderBrush}" 
                                    BorderThickness="0" 
                                    SnapsToDevicePixels="True"> 
                                    <syncfusion:GridExpanderCellControl Width="8" 
   Height="8"  HorizontalAlignment="Center"                              VerticalAlignment="Center" IsExpanded="{TemplateBinding IsExpanded}" SnapsToDevicePixels="True" /> 
                               </Border> 
                            </Grid> 
                        </Grid> 
                    </Border> 
                </Grid> 
            </ControlTemplate> 
        </Setter.Value> 
    </Setter> 
</Style> 


 


 


Please let us know if you have any query. 

Regards, 
Muthukumar K 



DE Denig June 9, 2017 10:19 AM UTC

Hello,

Thanks for your answer.
Your Answer1 set the hole Text to the right site.
i only want the itemcount and the arrow at the right site.

Your Answer2
the Background of my GroupLine are #838383. i think it was the same Foreground color then your arrow.
So i don't see the arrow
With your Answer3 i can set the Foreground of the arrow to white.
Now i want to set an other arrow style.and itemcount style.
 is this possible ?

so it looks:




This is what i wont to do:



greets


MK Muthukumar Kalyanasundaram Syncfusion Team June 13, 2017 04:03 AM UTC

Hi Greets, 

Thanks for the update. Please find the response from below table. 


Query 1: 
 I want to set another arrow style ? 


You can achieve your requirement by customizing the style of “GridExpanderCellControl” as shown like below code 


<Style TargetType="syncfusion:GridExpanderCellControl">  
    <Setter Property="IsTabStop" Value="False" />  
    <Setter Property="Foreground" Value="Red" />             
    <Setter Property="Template">  
        <Setter.Value>  
            <ControlTemplate TargetType="syncfusion:GridExpanderCellControl">                  
                    . . . . .  
                    . . . . .   
                    <Path x:Name="PART_GridExpanderCellPath"  
                        Width="{TemplateBinding Width}"  
                        Height="{TemplateBinding Height}"  
                        HorizontalAlignment="Center"  
                        VerticalAlignment="Center"  
                        Data="F1M4.005,4.805L0,0.698 0.717,0 4.005,3.373 7.293,0 8.01,0.698z" 
                        Fill="{TemplateBinding Foreground}"  
                        SnapsToDevicePixels="True"  
                        Stretch="Fill"  
                        Stroke="{TemplateBinding Foreground}"  
                        UseLayoutRounding="False">  
                        <Path.RenderTransform>  
                            <TransformGroup>  
                                <TransformGroup.Children>  
                                    <RotateTransform Angle="180" CenterX="4" CenterY="4" />  
                                </TransformGroup.Children>  
                            </TransformGroup>  
                        </Path.RenderTransform>  
                    </Path>  
                </Border>  
            </ControlTemplate>  
        </Setter.Value>  
    </Setter>  
</Style>      

 

Query 2: 
 I want to set an itemcount alone on righten side ? 


You can achieve your requirement by overriding “GridCaptionSummaryCellRenderer” class as shown like below code, 

Code Snippet: 

this.dataGrid.CellRenderers.Remove("CaptionSummary"); 
this.dataGrid.CellRenderers.Add("CaptionSummary", new GridCaptionSummaryCellRendererExt()); 

public class GridCaptionSummaryCellRendererExt : GridCaptionSummaryCellRenderer 
{ 
    public override void OnUpdateEditBinding(Syncfusion.UI.Xaml.Grid.DataColumnBase dataColumn, Syncfusion.UI.Xaml.Grid.GridCaptionSummaryCell element, object dataContext) 
    { 
        if (element.DataContext is Group && this.DataGrid.View.GroupDescriptions.Count > 0) 
        { 
            var groupRecord = element.DataContext as Group; 
            var groupedColumn = this.GetGroupedColumn(groupRecord); 
            if (this.DataGrid.CaptionSummaryRow == null) 
            { 
                if (this.DataGrid.View.GroupDescriptions.Count < groupRecord.Level) 
                    return; 
                //Set the CaptionSummaryCell text as customized. 
                element.Content = GetCustomizedCaptionText(groupedColumn.HeaderText, groupRecord.Key, groupRecord.ItemsCount); 
            } 
            else if (this.DataGrid.CaptionSummaryRow.ShowSummaryInRow) 
            { 
                element.Content = SummaryCreator.GetSummaryDisplayTextForRow(groupRecord.SummaryDetails, this.DataGrid.View, groupedColumn.HeaderText); 
            } 
            else 
                element.Content = SummaryCreator.GetSummaryDisplayText(groupRecord.SummaryDetails, dataColumn.GridColumn.MappingName, this.DataGrid.View); 
        } 
    } 
    private GridColumn GetGroupedColumn(Group group) 
    { 
        var groupDesc = this.DataGrid.View.GroupDescriptions[group.Level - 1] as PropertyGroupDescription; 
        foreach (var column in this.DataGrid.Columns) 
        { 
            if (column.MappingName == groupDesc.PropertyName) 
            { 
                return column; 
            } 
        } 
        return null; 
    } 
    private string GetCustomizedCaptionText(string columnName, object groupName, int itemsCount) 
    { 
        string entryText = string.Empty; 
        return string.Format("{0}: {1} {4}  ItemCount - {5}", columnName, groupName, "","", entryText.PadRight(80), itemsCount); 
   } 
} 

 


For more details about Summaries, you can refer the below link, 


Please let us know if you have any query. 

Regards, 
Muthukumar K 



DE Denig June 29, 2017 02:49 PM UTC

Hello,

thx for the answer of question 2

in the content i put a Grid as GetCustomizedCaptionText

Now can easy design the GroupRow


greets



MK Muthukumar Kalyanasundaram Syncfusion Team July 2, 2017 05:52 PM UTC

Hi Greets, 
 
Thanks for the update. Please let us know if you need any other assistance. 
 
Regards, 
Muthukumar K 


Loader.
Up arrow icon