Gantt Chart Not Displaying Data when SubTasks Attached
Dear Syncfusion Team,
I would like to take this opportunity to express my sincere gratitude for the exceptional work you’ve done in creating such a comprehensive suite of controls. Your commitment to providing a community license is greatly appreciated, as it allows developers like myself to create and innovate without financial constraints. Your efforts have not gone unnoticed and are truly making a difference in the developer community.
-------------------------------------------------------------------------------------------------------------------------------------------------------------
I have created Blazor Web App
(24.2.3)
with configurations
Version: .Net8
Theme: Bootstrap v5
Authentication: Individual Accounts
Interactivity type: Server
Interactivity location: Per page/component
This is my Dtos
And This is my endpoints
This is the result from endpoints
And this is my stored procudre
And this is my code from razor page
Now when there is no SubTasks the gantt show all data but when there is
SubTasks the
gantt show
No records to display
message .
can you plesae help me to solve this issue
Thank you once again for your outstanding contribution.
Hi Mahfoud,
Greetings
from Syncfusion Support,
We will check for feasibility to meet your requirement and we will provide you further details by or before Feb, 19, 2024.
Regards,
Ajithkumar G
Hi Mahfoud,
We suggest using a self-referencing data structure of the data source for easier database connectivity in Gantt Chart . Refer to the documentation link:-
Documentation : https://blazor.syncfusion.com/documentation/gantt-chart/data-binding#hierarchical-data-binding
In addition to that, we have shared the dataStructure of
Hierarchy collection
Video reference: https://www.syncfusion.com/downloads/support/directtrac/general/ze/GanttSelf-1755646381.zip
Document link: https://blazor.syncfusion.com/documentation/common/data-binding/bind-entity-framework
Data binding : https://blazor.syncfusion.com/documentation/gantt-chart/data-binding#self-referential--flat-data-binding
Still you need use DB connection with Hierarchy structure, we request you to share more information to validate
further. Kindly share the information below.
- Specific scenario you have faced the issue(Video demo)
- Replication steps for reproduce issue.
- The image of projectInfos data collection of data structure.
- If possible, replicate the issue in a shared sample and revert back to us.
Once we receive this information, we will be better equipped to identify the root cause of the issue and provide you with the necessary assistance.
Sample link: https://www.syncfusion.com/downloads/support/directtrac/general/ze/GanttSqlServer-945739039.zip
Regards,
Ajithkumar G
Hello Ajithkumar G,
I've included my Visual Studio 2022 solution and a video demonstrating the problem in the attachments. Hopefully, this will help you better understand the issue.
Attachment: SmartUltra_578a2c92.zip
Hi Mahfoud,
We are actively addressing your reported query with high priority and will provide an update by or before Feb, 23, 2024. Meanwhile we will contact you if any details required.
Regards,
Ajithkumar G
Hi Mahfoud,
We appreciate your patience.
We have validated the provided sample and identified an issue in your code. It seems that the class name for the Gantt chart collection is different from the class name for the subtasks collection. Specifically, the Gantt chart collection class is named ProjectMetallicConstructionGanttDto , while the subtasks collection class is named ProjectMetallicConstructionGanttDetailsDto. This inconsistency in class names might be the cause of the problem where no records are being displayed. To resolve this issue, make sure that both the Gantt chart collection class and the subtasks collection class have consistent and matching names throughout your code. we have attached a code snippet and a sample for reference.
Document link: https://blazor.syncfusion.com/documentation/gantt-chart/data-binding#hierarchical-data-binding
|
<SfGantt DataSource="@TaskCollection" > … </SfGantt>
@code { private List<TaskData> TaskCollection { get; set; } …
public class TaskData { public int TaskId { get; set; } public string TaskName { get; set; } public DateTime StartDate { get; set; } public DateTime? EndDate { get; set; } public string Duration { get; set; } public int Progress { get; set; } public List<TaskData> SubTasks { get; set; } }
… }
|
Sample link: https://blazorplayground.syncfusion.com/embed/LNBpXVrAhGWsRVZO?appbar=true&editor=true&result=true&errorlist=false&theme=bootstrap5
If you have any specific
concerns or encounter issues, please provide additional details or share a
sample that replicates the problem. We are here to assist you further.
Regards,
Ajithkumar G
Dear Ajithkumar G,
Apologies for the delayed reply. You're correct, aligning the Gantt chart collection and subtasks collection to the same class has resolved the issue.
Thank you very much
Hi Mahfoud,
You are welcome.
We are glad that our solution worked for you.
Please contact us if you require any further assistance.
Regards,
Ajithkumar G
- 7 Replies
- 2 Participants
-
MB Mahfoud Bouabdallah
- Feb 14, 2024 10:46 AM UTC
- Mar 1, 2024 01:15 PM UTC