This is a migrated thread and some comments may be shown as answers.

Gantt Chart didn't show data

1 Answer 68 Views
Gantt
This is a migrated thread and some comments may be shown as answers.
Leo
Top achievements
Rank 1
Leo asked on 16 Oct 2019, 08:09 AM

Dear Telerik, 

I want to use Gantt Chart load From Database, but after I run the data didn't show.

The steps are :

1. Create new project

2. Add Telerik RadScriptManager

3. Add RadGantt and SQL Data source. The table and data I copied from Telerik.mdf.

Here the code :

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
        <div>

            <div class="demo-container no-bg">
        <telerik:RadGantt RenderMode="Lightweight" ID="RadGantt1" 
            runat="server" 
            DataSourceID="SqlDataSource1" 
            DependenciesDataSourceID="SqlDataSource2" 
            ReadOnly="true" 
            SelectedView="WeekView">
            <DataBindings>
                <TasksDataBindings IdField="ID" ParentIdField="ParentID" StartField="Start" OrderIdField="OrderID" SummaryField="Summary" ExpandedField="Expanded" EndField="End" TitleField="Title"
                    PercentCompleteField="PercentComplete" />
                <DependenciesDataBindings TypeField="Type" IdField="ID" PredecessorIdField="PredecessorID" SuccessorIdField="SuccessorID" />
            </DataBindings>
        </telerik:RadGantt>
    </div>

    <asp:SqlDataSource runat="server" ID="SqlDataSource1" SelectCommand="SELECT * FROM [GanttTasks]" ConnectionString="<%$ ConnectionStrings:PM %>" ProviderName="<%$ ConnectionStrings:PM.ProviderName %>"/>
    <asp:SqlDataSource runat="server" ID="SqlDataSource2" SelectCommand="SELECT * FROM [GanttDependencies]" ConnectionString="<%$ ConnectionStrings:PM %>" ProviderName="<%$ ConnectionStrings:PM.ProviderName %>"/>
        </div>
    </form>
</body>
</html>

 

Thanks for any help

 

1 Answer, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 18 Oct 2019, 10:58 AM

Hi Leo,

I followed the given steps but the RadGantt data was successfully shown at my end. For convenience I am attaching my test project to this reply - are you able to reproduce the same behavior with it?

Regards,
Vessy
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Gantt
Asked by
Leo
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Share this question
or