GanttView with access database

2 posts, 0 answers
  1. Jorge
    Jorge avatar
    1 posts
    Member since:
    May 2015

    Posted 20 Jun 2015 Link to this post

    Hi there,

    How can i link the GanttView control with access data table? I mean how can i build the sql sentence and link to the gantt control?

    This is my code below:

            Dim strSQLCa As String
            Dim dsTask As New DataSet

            strSQLCa = "SELECT ID, PARENTID, TITLE, TSTART, TEND, TPROGRESS FROM TASK ORDER BY PROJID, PARENTID, ID"

            Dim adpTC As New OleDb.OleDbDataAdapter(strSQLCa, connPRO)
            dsTask.Tables.Add("TableTask")
            adpTC.Fill(dsTask.Tables("TableTask"))

            Dim data As New DataSet()
            data.Tables.Add("Task")

            Me.RadGanttView1.GanttViewElement.TaskDataMember = "Tasks"
            Me.RadGanttView1.GanttViewElement.ChildMember = "Id"
            Me.RadGanttView1.GanttViewElement.ParentMember = "ParentId"
            Me.RadGanttView1.GanttViewElement.TitleMember = "Title"
            Me.RadGanttView1.GanttViewElement.StartMember = "Start"
            Me.RadGanttView1.GanttViewElement.EndMember = "End"
            Me.RadGanttView1.GanttViewElement.ProgressMember = "Progress"
            Me.RadGanttView1.GanttViewElement.LinkDataMember = "Links"
            Me.RadGanttView1.GanttViewElement.LinkStartMember = "StartId"
            Me.RadGanttView1.GanttViewElement.LinkEndMember = "EndId"
            Me.RadGanttView1.GanttViewElement.LinkTypeMember = "LinkType"

            Me.RadGanttView1.GanttViewElement.DataSource = dsTask.Tables("TableTask")

            Me.RadGanttView1.Columns.Add("Start")
            Me.RadGanttView1.Columns.Add("End")

     

    And I'm getting the following error:

     "Child list for field Tasks cannot be created."

    Please can you guys help me with this?

     

    Thank you in advance.

    Jorge

  2. Hristo Merdjanov
    Admin
    Hristo Merdjanov avatar
    712 posts

    Posted 23 Jun 2015 Link to this post

    Hello Jorge,

    Thank you for writing.

    Usually this exception is thrown because the value set to the data member property, does not match the name of the table coming from your data set. Please check the following forum thread as this matter is also discussed there: https://social.msdn.microsoft.com/Forums/en-US/a4d70332-b6d8-4c72-abec-ce5e154fd578/child-list-for-field-customer-cannot-be-created?forum=adodotnetdataset.

    Generally speaking you can bind RadGanttView in several ways. Please check the articles in this section of our documentation: Working with Data. I created a project how you can bind to an access database using only the designer and alternatively, once you have your data set returned set up all the relations and assign the data source at run time.

    I hope this information was useful. Should you have further questions please do not hesitate to write back.

    Regards,
    Hristo Merdjanov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top