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

Parent Child Hierarchy

1 Answer 169 Views
Gantt
This is a migrated thread and some comments may be shown as answers.
Mohammad
Top achievements
Rank 1
Mohammad asked on 30 Dec 2014, 12:18 PM
I have following RadGantt chart it is not showing parent child hierarchy properly. it is creating hierarchy but displaying same as parent.

<
telerik:RadGantt runat="server" ID="RadGantt1"
                            SnapToGrid="false"
                            OnDependencyInsert="RadGantt1_DependencyInsert"
                            OnDependencyDelete="RadGantt1_DependencyDelete"
                            OnTaskDelete="RadGantt1_TaskDelete"
                            OnTaskUpdate="RadGantt1_TaskUpdate"
                            OnTaskInsert="RadGantt1_TaskInsert" SelectedView="WeekView" AutoGenerateColumns="false"
                            OnPreRender="RadGantt1_PreRender">
                            <YearView UserSelectable="true" />
                            <Columns>
                                <telerik:GanttBoundColumn DataField="Title"></telerik:GanttBoundColumn>
                                <telerik:GanttBoundColumn DataField="Start"></telerik:GanttBoundColumn>
                                <telerik:GanttBoundColumn DataField="End"></telerik:GanttBoundColumn>
                                <telerik:GanttBoundColumn DataField="Duration" DataType="DateTime" HeaderText="Duration" DataFormatString="{0:HH\:MM\:SS}"></telerik:GanttBoundColumn>
                            </Columns>
                            <DataBindings>
                                <TasksDataBindings IdField="ID" TitleField="Title" StartField="Start" EndField="End"
                                    PercentCompleteField="PercentComplete" OrderIdField="OrderID" SummaryField="Summary" ParentIdField="ParentID" />
                                <DependenciesDataBindings IdField="ID" PredecessorIdField="PredecessorID"
                                    SuccessorIdField="SuccessorID" TypeField="Type" />
                            </DataBindings>
                        </telerik:RadGantt>



while (reader.Read())
                    {
                        Task t = new Task();
 
                        t.ID = reader.GetValue(0);
                        t.Title = reader.GetString(1);
                        t.Start = reader.GetDateTime(2);
                        t.End = reader.GetDateTime(3);
                        t.PercentComplete = decimal.Parse(reader.GetValue(4).ToString());
                        t.OrderID=1;
                        t.ParentID = reader.GetValue(5);
                        sessionTasks.Add(t);
                    }
RadGantt1.DataSource = Tasks;
           RadGantt1.DependenciesDataSource = Dependencies;


1 Answer, 1 is accepted

Sort by
0
Nencho
Telerik team
answered on 02 Jan 2015, 08:15 AM
Hello Mohammad,

I have performed some local tests, using the demonstrated implementation that you have set at your and the parent/child hierarchy is correctly achieved at my end. Please make sure that the ParentID fields are correctly set in your datasource, so that the RadGantt control could read them properly and visualized the hierarchy.

If you still experience any issues, please submit a support ticket and provide us with a simplified runnable sample, along with the datasource that you use, so we could inspect it locally and troubleshoot the problem for you.

Regards,
Nencho
Telerik
Tags
Gantt
Asked by
Mohammad
Top achievements
Rank 1
Answers by
Nencho
Telerik team
Share this question
or