Fomat customschedule

Hi,

is it possible to have the same format written in the cell also in the tooltip?



Best regads
Gian Piero Truccolo


5 Replies 1 reply marked as answer

SS Sridevi Sivakumar Syncfusion Team May 6, 2021 11:20 AM UTC

Hi Gian Piero Truccolo,

Greetings from Syncfusion.

Query: is it possible to have the same format written in the cell also in the tooltip?

Yes. We can achieve it by setting the expected format in the cell tooltip in ScheduleCellCreated event as per the below code snippet.


[XAML]:
 
<sync:GanttControl x:Name="Gantt"  ScheduleCellCreated="Gantt_ScheduleCellCreated" 
                               ItemsSource="{Binding TaskDetails}" 
                               ScheduleType="CustomNumeric"> 
        <sync:GanttControl.TaskAttributeMapping> 
    .... 
        </sync:GanttControl.TaskAttributeMapping> 
    </sync:GanttControl> 
[C#]: 
        private void Gantt_ScheduleCellCreated(object sender, ScheduleCellCreatedEventArgs args) 
        { 
            args.CurrentCell.CellToolTip = args.CurrentCell.CellDate.ToString("dd/MM"); 
        } 
Please have a sample from the below link.
https://www.syncfusion.com/downloads/support/directtrac/general/ze/Sample-1693569226

Let us know if you need any further assistance

Regards,
Sridevi S.
 
 



GI Gian May 6, 2021 12:09 PM UTC

Hi,

yes i have seen this possibility but my case is different.

I have set dd/MM for the first GanttScheduleRowInfo and another format for the second GanttScheduleRowInfo.

I want to aplly for each cell the format i have set in to GanttScheduleRowInfo.Cellformat.

Is this possible?

Best regards 
Gian Piero Truccolo


SS Sridevi Sivakumar Syncfusion Team May 7, 2021 10:11 AM UTC

Hi Gian Piero Truccolo,

Query: I have set dd/MM for the first GanttScheduleRowInfo and another format for the second GanttScheduleRowInfo. Is this possible?
 

Yes, we can set the different tooltip format for each row by customizing ScheduleCellCreated event argument ( args.CurrentCell.CellTimeUnit) based on condition as per below code snippet  
[C#]: 
        private void Gantt_ScheduleCellCreated(object sender, ScheduleCellCreatedEventArgs args) 
        { 
            if (args.CurrentCell.CellTimeUnit == TimeUnit.Weeks) 
            { 
                args.CurrentCell.CellToolTip = args.CurrentCell.CellDate.ToString("dd/MM"); 
            } 
            else 
            { 
                args.CurrentCell.CellToolTip = args.CurrentCell.CellDate.ToString("dd/MM/yyyy"); 
            } 
        } 
Let us know if you need any further assistance.

Regards,
Sridevi S.
 
 



GI Gian May 7, 2021 10:37 AM UTC

Hi,

thanks for the answer , but what i want to know if i can set the cell format of that specific cell that is connect to the GanttScheduleRowInfo.Cellformat. So that i can use GanttScheduleRowInfo.Cellformat as string format.

Best regards
Gian Piero Truccolo



ET Eswaran Thirugnanasambandam Syncfusion Team May 10, 2021 11:19 AM UTC

Hi Gian Piero Truccolo, 
 
Thanks for your update.  
 
We have checked your requirement and would like to inform that the only way to format the Schedule cell’s ToolTip text is setting CellToolTip from ScheduleCellCreated event. But the ScheduleCellCreated event arguments does not contains the CellFormat value. So, it is not possible to set the CellFormat as ToolTip's format, we need to specify it manually as like we have provided in our last update. 
 
If your requirement is different from this, please provide additional information about your requirement. This would be helpful for us to give better solution. 
 
Regards, 
Eswaran 


Marked as answer
Loader.
Up arrow icon