How to change the text in duration column?

Hi,

how can i change the text "x days" in duration column to another language?

Kind regards 

Jörg

32 Replies 1 reply marked as answer

SS Sridevi Sivakumar Syncfusion Team December 22, 2020 10:20 AM UTC

Hi Jörg,

Greetings from Syncfusion.


We can achieve your requirement as changing the days text to another language by adding the customized duration column to the Gantt control. We have prepared a workaround sample. Please have a sample from the below link.

https://www.syncfusion.com/downloads/support/forum/160839/ze/Sample-1005121254

Code snippet: 
  private void GanttGrid_Loaded(object sender, RoutedEventArgs e) 
        { 
            GridTreeColumn DurationColumn = new GridTreeColumn(); 
            DurationColumn.StyleInfo = new GridStyleInfo 
            { 
                CellType = "TimeSpanEdit", 
                TimeSpanEdit = new GridTimeSpanEditStyleInfo { Format = "d' Tage'" }, 
                HorizontalAlignment = HorizontalAlignment.Left, 
                VerticalAlignment = VerticalAlignment.Center 
            }; 
  
            DurationColumn.MappingName = "Duration"; 
            DurationColumn.HeaderText = "Duration"; 
  
            for (int i = 0; i < this.Gantt.GanttGrid.Columns.Count; i++) 
            { 
                if (this.Gantt.GanttGrid.Columns[i].MappingName == "Duration") 
                { 
                    // Remove the old duration column. 
                    this.Gantt.GanttGrid.Columns.RemoveAt(i); 
  
                    // Added the customized duration column. 
                    this.Gantt.GanttGrid.Columns.Insert(i, DurationColumn); 
                    break; 
                } 
            } 
  
        } 

Screenshot:


Regards,
Sridevi S. 
 
 



Jörg December 22, 2020 10:55 AM UTC

Hi Sridevi,

thanks this works fine.

Regards,
Jörg


Jörg December 22, 2020 12:44 PM UTC

Hi Sridevi,

do you have a similar solution for tooltip? Duration in tooltip is also followed by days in english language. And I have to change the date format of Start date and Finish date from english to german format.

Thank you for your support.

Regards,
Jörg


SS Sridevi Sivakumar Syncfusion Team December 23, 2020 10:42 AM UTC

Hi Jörg,

Thanks for your update.

We have checked your requirement and achieved by using customized ToolTipTemplate. Please have a sample from the below link.

Link: https://www.syncfusion.com/downloads/support/forum/160839/ze/Gantt_Sample1323183363

In this ToolTipTemplate, we have displayed TaskName, TaskId, Start Date, Finish Date, and duration. We have converted the duration, text, start and finish date format in the converter class.


[XAML]
 
 <sync:GanttControl.ToolTipTemplate> 
                <DataTemplate> 
                    <Grid> 
 ... 
               <TextBlock Margin="1" 
                   Text="{Binding StartDate,Converter={StaticResource textConverter}}" 
                   Grid.Row="2" 
                   Grid.Column="1" 
                   VerticalAlignment="Center" 
                   FontFamily="Verdana"/> 
... 
  
                        <TextBlock Margin="1" 
                   Text="{Binding FinishDate,Converter={StaticResource textConverter}}" 
                   Grid.Column="1" 
                   Grid.Row="3" 
                   VerticalAlignment="Center" 
                   FontFamily="Verdana"/> 
.. 
  
                        <TextBlock Margin="1" Height="25" 
                     Text="{Binding Duration,Converter={StaticResource textConverter}}" 
                     Grid.Column="1" 
                     VerticalAlignment="Center" 
                     Grid.Row="4"/> 
                    </Grid> 
                </DataTemplate> 
            </sync:GanttControl.ToolTipTemplate> 
C#: 
public class TextConverter : IValueConverter 
    { 
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 
        { 
            string val = value.ToString(); 
            int length = val.Length; 
            if (val[length - 1] == 'M') 
            { 
                // To convert start and finish date format 
                DateTime date = DateTime.Parse(value.ToString()); 
                val = date.ToString("dd.MM.yyyy hh:mm:ss tt"); 
            } 
            else 
            { 
                // To convert duration text 
                val = val.Remove(1, 9) + " Tage"; 
            } 
            return val; 
        } 
  
  
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 
        { 
            return value; 
        } 
    } 


For more information to customize the tooltip. Please refer below UG.
https://help.syncfusion.com/wpf/gantt/customtooltip

Please let us know if you have any queries.

Regards,
Sridevi S.
 


Marked as answer

Jörg December 23, 2020 03:59 PM UTC

Hi Sridevi,

thanks for your support.
I had to change your solution a few because we don't devide time into AM and PM in Germany and so I can't query that.
Also Duration may be more than 9 days.
But now it works.
Thank you very much for your support.

Kind regards and Merry Christmas

Jörg


SS Sridevi Sivakumar Syncfusion Team December 24, 2020 10:50 AM UTC

Hi Jörg,

Thanks for your update.

We are glad that the requirement has been achieved and please get back to us if you need any other assistance.

Regards,
Sridevi S.
 



Jörg December 24, 2020 10:55 AM UTC

Bye the way.
How to use the Localization in this case?

Kind regards,
Jörg


SS Sridevi Sivakumar Syncfusion Team December 28, 2020 11:34 AM UTC

 Hi Jörg,

Thanks for your update.


We suspect that your query is to set Localization for Gantt control. You can achieve this by using solution available in below link.

https://help.syncfusion.com/wpf/gantt/localization

Please check this and let us know whether your requirement is achieved or not. If we misunderstood your requirement, please share more details.

Regards,
Sridevi S. 
 



Jörg December 29, 2020 08:56 AM UTC

Hi Sridevi,

thanks for your answer. In yout tooltiptemplate example text e.g. for Duration is static english Duration:

 <TextBlock Margin="1" Text="Duration:" 
                   Grid.Column="0"
                   Grid.Row="4" 
                   VerticalAlignment="Center" 
                   FontFamily="Verdana"/>

But I use Localization in my application. If I remove Text="Duration:" there is no text for it. How to use there the standard localization?

Kind regards,

Jörg.


SS Sridevi Sivakumar Syncfusion Team December 30, 2020 03:15 PM UTC

Hi Jörg ,

TooltipTemplate is used:

If you use a tooltip template, we can't change the duration text by using localization. We will change the text by template only.

TooltipTemplate is not used:


In this case, just change CurrentUICulture, and add equivalent value for the duration in .resx file, then it will be localized automatically. 


But in this case tooltip days text does not get localized. We have internally logged a bug for “Days string in duration column and mouse hover tooltip does not get localized”. This fix will be included in the upcoming weekly NuGet this fix will be rolled out by January 5, 2021.

Regards,
Sridevi S.
 



Jörg December 30, 2020 03:23 PM UTC

Hi Sridevi,

thank you very much. That are good news.
I wish you a prosperous New Year.

Regards,

Jörg


SS Sridevi Sivakumar Syncfusion Team December 31, 2020 10:12 AM UTC

Hi Jörg,

Thanks for your update.

As promised earlier we will include the fix in our upcoming weekly NuGet this fix will be rolled out by January 5, 2021.

Please let us know if you need any further assistance.

Regards,

Sridevi S.  



Jörg January 5, 2021 11:53 AM UTC

Hi Sridevi,

I installed 18.4.0.33, the weekly update of today. In the weekly release notes I didn't find anything about this issue  “Days string in duration column and mouse hover tooltip does not get localized”.
In my program I didn't fill text in the tooltip template and it comes without any tooltip text. Will this issue be solved later or have I to do something in my program?

Kind regards,

Jörg


SS Sridevi Sivakumar Syncfusion Team January 5, 2021 01:51 PM UTC

Hi Jörg,

We have fixed the reported issue and the fix is included in our weekly NuGet of January 5, 2021.

NuGet Version: 18.4.0.33

We would like to inform you that we do not add internal bug status in our release notes.

And tooltip text will be localized automatically by setting the CurrentUICulture, please add an equivalent value for the days in the .resx file.

Regards,
Sridevi S. 



Jörg January 5, 2021 02:27 PM UTC

Hi Sridevi,

sorry but I don't understand you.. 
Of course CurrentUICulture is set and I use localization.
Relevant text in the Syncfusion.Gantt.WPF.de.resx is translated:



In the tooltip template e.g for duration I use:

<TextBlock Margin="1"
                                    Grid.Column="0"
                                    Grid.Row="4" 
                                    VerticalAlignment="Center" 
                                    FontFamily="Segoe UI"/>

without 

Text="Duration:"  or Text="Dauer:" 
Result in the program is:



What is my problem?

Regards,

Jörg


SS Sridevi Sivakumar Syncfusion Team January 6, 2021 02:40 PM UTC

Hi Jörg,

Please find the solutions.

With using the tooltip template:

We can't localize the text by using Syncfusion.Gantt.WPF.de.resx and culture when we use the tooltip template. In this case, we need to add the expected culture text directly to the tooltip template duration TextBlock.

Code snippet:
[XAML]:
 
 
                 Text="Durée:" 
                   Grid.Column="0" 
                   Grid.Row="4" 
                   VerticalAlignment="Center" 
                   FontFamily="Verdana"/> 
 

Without the tooltip template:
If we run the application without a tooltip template, we need to add Syncfusion.Gantt.WPF.de.resx and culture for localization. We have prepared a simple sample for localization in French culture. Please have the sample from the below link.

Sample link: https://www.syncfusion.com/downloads/support/forum/160839/ze/Localization_Gantt-1217432432

Syncfusion.Gantt.WPF.de.resx  file
:
 


Note:
Duration used to customize the column duration text.
DurationTooltip used to customize the tooltip duration text.
 

Output:


Let us know if you need any further assistance.

Regards,
Sridevi S.
 
 



Jörg January 6, 2021 03:01 PM UTC

Hi Sridevi,

thanks,

If I disable tooltip template, add Days in Syncfusion.Gantt.WPF.de.resx ... then it looks like this:


Text is translated but date format is english.
If I use tooltip template I can change date format but I am not able to localize text for different languages.

That is not good, but it seems I have to live with it. The lesser evil is to show the english date format with localized text.

Kind regards,

Jörg


SS Sridevi Sivakumar Syncfusion Team January 7, 2021 04:02 PM UTC

Hi Jörg,

Currently, we do not have support to localize the DateTime based on the specified culture.
We have achieved your requirement in sample level. Please have a sample from the below link

Sample link: https://www.syncfusion.com/downloads/support/forum/160839/ze/Gantt_Sampe(de)981434894

We need to remove culture code from MainWindow.cs page

[ MainWindow.cs ]:
 
    public partial class MainWindow : Window 
    { 
        public MainWindow() 
        { 
            Thread.CurrentThread.CurrentUICulture = new CultureInfo("de-DE"); 
            Thread.CurrentThread.CurrentCulture = new CultureInfo("de-DE"); 
                     InitializeComponent();             
        } 
    } 

And add the following code in APP.cs page
[APP.cs]
 
    public partial class App : Application 
    { 
        static App() 
        { 
            Thread.CurrentThread.CurrentUICulture = new CultureInfo("de-DE"); 
            Thread.CurrentThread.CurrentCulture = new CultureInfo("de-DE"); 
                 FrameworkElement.LanguageProperty.OverrideMetadata( 
                typeof(FrameworkElement), new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag))); 
        } 
    } 

Screenshot:


Let us know if you need any further assistance.

Regards,
Sridevi S.
 
 



Jörg January 7, 2021 05:26 PM UTC

Hi Sridevi,

thanks, that works fine.

Regards,

Jörg.


SS Sridevi Sivakumar Syncfusion Team January 8, 2021 07:30 AM UTC

Hi Jörg,

Thanks for your update.


We are
 glad that the reported problem resolved at your end.

Let us know if you need any further assistance.


Regards,

Sridevi S. 


Jörg January 13, 2021 03:55 PM UTC

Hi Sridevi,

today I installed Syncfusion 18.4.0.34 and I got a new problem.
When I want to show the gantt schedule tooltip with mouseover I get the error in appendix.
I get similar errors with mouseover at closing-button of ribbon window.

I had a similar problem with DoubleTextBox and IntegerTextBox (both in SfTextInputLayout). The following error rised in TextCharacter.cs:
throw new ArgumentOutOfRangeException("textRunProperties.FontRenderingEmSize", SR.Get(SRID.ParameterMustBeGreaterThanZero));
When I set a Fontsize for DoubleTextBox and IntegerTextBox I get no error.

By the way I use .Net 5.0

Regards,

Jörg



Attachment: error_syncfusion_20210113_5febd94b.zip


ET Eswaran Thirugnanasambandam Syncfusion Team January 14, 2021 11:45 AM UTC

Hi Jörg, 
  
Thanks for your update. 
 
We checked the provided stack trace, and we didn’t find any Syncfusion control name in the stack trace. Since the same issue occurs in all reported control, we suspect that the reported issue occurs due to the use of .NET 5.0 Framework. So, could you please confirm whether the issue occurs due to the .NET 5.0 framework or not. 
 
If the issue occurs in other case, please share the replication video with code snippet so that we give appropriate solution for the reported issue.  
  
Regards, 
Eswaran 



Jörg January 15, 2021 07:24 AM UTC

Hi Eswaran,

thanks for your update.
Sorry, but I don't know how to  confirm whether the issue occurs due to the .NET 5.0 framework or not and I don't know what you mean with replication video.

But in my opinion the error occurs only with Syncfusion tools.
So I made a simple test application with .Net 5.0 and Syncfusion Ribbon and very few functionality, you will see in the appendix. 
If you start the application please mouseover Minimize-Button or Close-Button and you will see the error.It also occurs with mouseover at QuickAccessToolBar.

Is it possible, that the problem relates to SkinManager and / or the theme I use?

Regards,

Jörg


Attachment: Test_Ribbon_c75f6b.zip


EM Elakkiya Muthukumarasamy Syncfusion Team January 15, 2021 12:43 PM UTC

Hi Jörg, 

Thanks for your update 

We were able to reproduced the reported issue “Argument exception thrown while mouseover Minimize-Button or Close-Button” and our development team analyzing the root cause for these issues. We will update you the further details on 18th January 2021.We appreciate your patience until then. 

Regards, 
Elakkiya  



VR Vijayalakshmi Roopkumar Syncfusion Team January 18, 2021 12:56 PM UTC

Hi Jorg,  
 
Thank you for your patience. 
 
We have consider the reported behavior "Argument exception thrown while mouseover minimize-button or close button" is a defect and logged a report on this. This fix would be availablie in Volume 4, SP1, estimated to be available by end of Jan,2021 . We will share the feedback link shortly. 
 
Regards, 
Vijayalakshmi VR 



Jörg January 18, 2021 02:36 PM UTC

Hi Vijayalakshmi,

thanks for your status update. I hope, you recognized that "mouseover minimize-button or close button" is only an example. Some other tools like mouseover gantt schedule, integer textbox, double textbox have a similar behavior.

Regards,

Jörg.


VR Vijayalakshmi Roopkumar Syncfusion Team January 19, 2021 09:38 AM UTC

Hi Jorg 
 
As updated earlier, the fix for the reported behavior would be included in our Vol 4, SP1 release expected to be rolled out by 27th Jan, 2021. Please find the feedback link for the reported behavior from the following link: 
 
 
However we have tried to reproduce this exception on mouse over the control such as IntegerTextBox, DoubletTextBox and Gantt schedule, but we are unable to reproduce this exception,  
 
Please find the sample, video for the same. 
 
 
 
 
 
So please check the sample and confirm us whether our replication is correct to reproduce the reported behavior with Integer, Double and Gantt schedule control. If not, kindly modify our sample into issue  
reproducible, it would be helpful for us to consider the bug on these controls.  
 
Kindly let us know if you need any further assistance on this. 
 
Regards, 
Vijayalakshmi VR 



Jörg January 19, 2021 11:31 AM UTC

Hi  Vijayalakshmi,

thanks for your update.

I prepared a new example with the reported behavior you will see in appendix.

Please start the application, go to menu and mouse over one task of the gantt schedule. Then you will see the error.

If you remove FontSize="12" from IntegerTextBox TxsDuration and/or DoubleTextBox TxsProgress in XAML-Code of Mater, you will see the error. The application isn't able to start.

Regards,

Jörg

 

Attachment: Test_Ribbon_97931773.zip


EM Elakkiya Muthukumarasamy Syncfusion Team January 20, 2021 01:08 PM UTC

Hi Jorg, 

Thanks for your update and sorry for the inconvenience. 

We will fix this issue also and as updated earlier, the fix for the reported behavior would be included in our Vol 4, SP1 release expected to be rolled out by 27th Jan, 2021. Please find the feedback link for the reported behavior from the following link:  
  
 
Note: This issue breaks in 18.4.0.34 weekly nuget release version. Its works fine until 18.4.0.33 version. 

Please let us know if you have any other concerns. 

Regards, 
Elakkiya 



Jörg January 22, 2021 08:49 AM UTC

Hi,
now I've got a new problem with DateTimePicker. It seems, it also is based on SfSkinManager.

If I use DateTimePicker with >> DropDownView="Combined" <<, SkinManager and Theme I get an error as in the appendix.
If I use it without DropDownView="Combined or without Theme it works fine.

Regards,

Jörg.

Attachment: Test_DateTimePicker_90be5107.zip


VR Vijayalakshmi Roopkumar Syncfusion Team January 25, 2021 10:55 AM UTC

Hi Jorg 
 
Thank you for your update. 
 
We have checked the reported behavior with DateTimeEdit and confirmed it is a defect with DateTimeEdit control. So we have forwarded this to concern development team and created an incident #312173 under your account #1292858. So please track with that incident for further update on this. 
 
 
Please let us know if you need any further assistance on this. 
 
Regards, 
Vijayalakshmi VR 



VR Vijayalakshmi Roopkumar Syncfusion Team January 28, 2021 10:24 AM UTC

Hi Chris, 
 
Thank you for your patience. 
 
We are glad to announce that our Essential Studio 2020 Volume 4 Service Pack Release v18.4.0.39 is rolled out with the fix for the reported issue “Argument exception thrown while mouseover minimize-button or close button and is available for download under the following link. 
 
  
  
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance. 
 
Regards,  
Vijayalakshmi VR 


Loader.
Up arrow icon