SQL Database

30 posts, 0 answers
  1. Colin Wright
    Colin Wright avatar
    26 posts
    Member since:
    Mar 2008

    Posted 02 May 2012 Link to this post

    Has anyone  got an example or tutorial of using SQL Tables to store Gantt View information?
  2. George
    Admin
    George avatar
    1332 posts

    Posted 08 May 2012 Link to this post

    Hi,

    We prepared a sample example how to populate the RadGanttView with a data from a SqlServer. In the attached zip file you can find the project plus db schema and backup which will restore the database with a sample data. Also, the connection string must be modified for the correct server name.

    Please, note that the GanttView is still in CTP version and there could be some breaking changes with the official release, but they will be documented and the project will be modified. The attached sample works with the official Q1 SP1 assemblies.

    Hope this helps.

    Greetings,
    George
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. UI for WPF is Visual Studio 2017 Ready
  4. Kholisa
    Kholisa avatar
    10 posts
    Member since:
    May 2012

    Posted 16 May 2012 Link to this post

    Hi There

    I was trying to use the example you uploaded example and i got an error that says GanttViewDBEntities is missing an assembly, how to I solve that as I urgently want to save information to database

    Thanks 
  5. George
    Admin
    George avatar
    1332 posts

    Posted 16 May 2012 Link to this post

    Hi,

    Please, double check the connection string in the project. It must match the correct server and database.

    Greetings,
    George
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  6. Kholisa
    Kholisa avatar
    10 posts
    Member since:
    May 2012

    Posted 18 May 2012 Link to this post

    Hi

    I manage to connect to sql database but now the ganntt loads empty, where do you do your stored procedures (select,Insert,Update) as i want to perform those in my gannt

    Thanks
  7. Kholisa
    Kholisa avatar
    10 posts
    Member since:
    May 2012

    Posted 22 May 2012 Link to this post

    Hi George

    I am connected to database but the form loads null, i have create the stored procedure on sql and imported to emdx funtion.
    My SELECT Statement

    SELECT

     

    Title,Description

    FROM

     

    dbo.SqlTasks

    looking forward to your response, really need your help
  8. George
    Admin
    George avatar
    1332 posts

    Posted 28 May 2012 Link to this post

    Hello,

    Please, double check whether the database contains any records. Moreover, check the VisibleRange of the GanttView and if there are any tasks what are visible in the ranged.

    Kind regards,
    George
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  9. Erik
    Erik avatar
    3 posts
    Member since:
    Jul 2011

    Posted 30 Jul 2012 Link to this post

    Hi George,

    I'm interested in using the GanttView control and I downloaded the example you posted here but I can't try it. I attached the .bak file to my SQL Server 2008 and then I opened it in Visual Studio 2010 and change the ConnectionString so it match my server. First it says that there is no type known as IRelation (I solve this by adding the Telerik.Windows.Data reference). After that appears a lot of errors. I show you them in the attached image.
    Could you help me and guide me to the solution? Sorry if I'm missing something evident.

    Regards,

    Erik
  10. George
    Admin
    George avatar
    1332 posts

    Posted 03 Aug 2012 Link to this post

    Hello Erik,

    With the Q2 release we introduced some breaking changes for the control which could cause the issues you faced with. Please, refer to our online documentation for more information about RadGanttView backward compatibility - http://www.telerik.com/help/silverlight/radganttview-backward-compatibility.html 

    Hope this helps.

    Regards,
    George
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  11. Eddie
    Eddie avatar
    1 posts
    Member since:
    Oct 2012

    Posted 30 May 2013 Link to this post

    Hello everyone,

    Is there any updated versión of this simple for the 2013 version of Silverligth? 

    I mostly get issues in the SQLTask.cs here:

     

    private IList relations;
    IList IGanttTask.Relations
    {
        get
        {
            if (this.relations == null)
            {
                using (var context = new GanttViewDBEntities())
                {
                    this.relations = context.SqlTasks.Single(task => task.SqlTaskId == this.SqlTaskId).SqlRelations.ToList();
                }
            }
            return this.relations;
        }
    }

     

    I really would appreciate your help, on this matter.

  12. Ventzi
    Admin
    Ventzi avatar
    114 posts

    Posted 31 May 2013 Link to this post

    Hi Eddie,

    I'm sending you attached a recently made sample project which demonstrates how to use RadGanttView with a DB as source. In the web project is also a sql script included which should help you to create the basic DB table which is needed for this example.

    I hope this helps.

    Regards,
    Ventzi
    Telerik

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  13. Sebastien
    Sebastien avatar
    11 posts
    Member since:
    Jun 2014

    Posted 25 Jul 2014 in reply to Ventzi Link to this post

    Hi Ventzi,

    Thanks for this project. It clarifies a bit the way to store the data in a database. It seems there is an issue when I try to move a task on upper level or lower level (slide it up or down with the mouse). Silverlight crashes when it renders the page. Would it be possible to have a look?

    More generally how to you save the order of tasks in the database and how you retried them in the correct order to display them ?

    And is it possible later on to export Telerik tasks into Microsoft Project?

    I want to use this Telerik control in order to offer to our user an easy tool to manage their tasks and to avoid the complexity of
    Microsoft Project.

    Thanks

    Sebastien
  14. George
    Admin
    George avatar
    1332 posts

    Posted 29 Jul 2014 Link to this post

    Hi Sebantien,

    Can you send us a video of the exception? What type of exception is it? This will be helpful in order to reproduce the problem.

    According to the saving/retrieving the tasks - they are retrieved in the way they are saved and this is automatically handled by EF. Note that the tasks are retrieved in a time range in the GanttViewDomainService.

    Currently only importing from MS project is available for RadGanttView - example of that can be found here. Exporting to MS Project is not implemented yet. It is logged as future request here and you can vote for it. If it gets enough clients request, we will review it for our upcoming development. 

    I am looking forward to your reply.

    Regards,
    George
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  15. Sebastien
    Sebastien avatar
    11 posts
    Member since:
    Jun 2014

    Posted 31 Jul 2014 in reply to George Link to this post

    Hi Georges,

    Thanks for your help. I did a little video that shows you the issue using Microsoft Expression Encoder. (Replace extension .jpg by .xesc and it should work). Hope you will be able to read it.

    The video start by showing the db structure. Then the project itself that is a copy from Telerik example with a Master page.
    I try to move up a task and the Gantt control crash.

    Best regards
    Sebastien

  16. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 04 Aug 2014 Link to this post

    Hello Sebastien,

    We managed to reproduce the issue with the example - it was caused by an improvement with the implementation of the GanttView control introduced after the example was posted in this thread. What you need to do in order to fix it is would be to also inherit from the IEditableHierarchical interface in the SqlTask class:

    public partial class SqlTask : IGanttTask, IMilestone, ISummary, IDependant, IEditableHierarchical
    {
       ...
    }

    Afterwards you have to implement the two methods coming from the interface the following way:

    public void InsertChildAtIndex(object item, int index)
    {
        var tasks = (ObservableCollection<SqlTask>)this.Children;
        var ganttTask = item as SqlTask;
        if (ganttTask != null && index <= tasks.Count)
        {
            tasks.Insert(index, ganttTask);
            var sqlParentChildTask = new SqlParentChildTask() { ParentTaskId = this.Id, ChildTaskId = ganttTask.Id };
            GanttViewRepository.Context.SqlParentChildTasks.Add(sqlParentChildTask);
        }
    }
     
    public void Remove(object item)
    {
        var tasks = (ObservableCollection<SqlTask>)this.Children;
        var ganttItem = item as SqlTask;
        if (ganttItem != null)
        {
            tasks.Remove(ganttItem);
            var sqlParentChildTask = GanttViewRepository.Context.SqlParentChildTasks.FirstOrDefault(ct => ct.ChildTaskId == ganttItem.Id);
            if (sqlParentChildTask != null)
            {
                GanttViewRepository.Context.SqlParentChildTasks.Remove(sqlParentChildTask);
            }
        }
    }

    Please give it a try and let me know if it resolves the issue.

    Hope this helps. I have also updated your Telerik points for your involvement.

    Regards,
    Kalin
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  17. Sebastien
    Sebastien avatar
    11 posts
    Member since:
    Jun 2014

    Posted 05 Aug 2014 in reply to Kalin Link to this post

    Hi Kalin,

    Thanks a lot for the fast reply. I tested it this morning and it works fine. I noticed one more issue that I can reproduce on the sample project. If you add more than one task in a row(not a child) , only the first task added is saved in the database.

    Regards
    Sebastien
  18. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 05 Aug 2014 Link to this post

    Hi Sebastien,

    Thanks for your feedback - I have managed to reproduce the issue. In order to fix it you will have to modify the InsertTask method of the GanttViewModel class the following way:

    internal bool InsertTask(SqlTask task)
    {
        if (!this.IsChild(task, this.tasks))
        {
            this.tasks.Add(task);
     
            if (task.EntityState == EntityState.Detached)
            {
                GanttViewRepository.Context.SqlTasks.Add(task);
                return true;
            }
        }
     
        return false;
    }

    Hope this helps.

    Regards,
    Kalin
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  19. Sebastien
    Sebastien avatar
    11 posts
    Member since:
    Jun 2014

    Posted 05 Aug 2014 in reply to Kalin Link to this post

    Thanks again Kalin. It works fine.
    Greetings from Stockholm
    Sebastien
  20. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 05 Aug 2014 Link to this post

    Hi Sebastien,

    I'm glad it helped. If you have any other question or concerns, please do not hesitate to contact us.

    Regards,
    Kalin
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  21. Sebastien
    Sebastien avatar
    11 posts
    Member since:
    Jun 2014

    Posted 06 Aug 2014 in reply to Kalin Link to this post

    Hello Kalin,

    I’m facing a new problem link to dependency between tasks. Prior to be saved all new tasks added have the same id = 0. If I add 3 new tasks in a row with dependency between them, then only the first task added will keep its dependency.

    The work around is to save automatically after adding a new task and after all manipulation in the UI. I tried to implement the events ManipulationCompleted, ManipulationDelta, ManipulationStarted, I got the error message: Failed to assign to property 'System.Windows.UIElement.ManipulationCompleted'.

    Best regards

    Sebastien

  22. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 11 Aug 2014 Link to this post

    Hello Sebastien,

    I managed to reproduce the issue. After further investigation it appears that the easiest solution in this case would be to Save after each new Task is added. You will need to replace the InsertTast method with the following one:

    internal bool InsertTask(SqlTask task)
    {
        if (!this.IsChild(task, this.tasks))
        {
            this.tasks.Add(task);
     
            if (task.EntityState == EntityState.Detached || task.EntityState == EntityState.New)
            {
                GanttViewRepository.Context.SqlTasks.Add(task);
                GanttViewRepository.SaveData();
                return true;
            }
        }
     
        return false;
    }

    However we will think of the better solution later on when possible.

    Please test and let me know if this works for you.

    Regards,
    Kalin
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  23. Sebastien
    Sebastien avatar
    11 posts
    Member since:
    Jun 2014

    Posted 12 Aug 2014 in reply to Kalin Link to this post

    Hi kalin,

    I also moved into that direction and auto-save all new tasks. Your code works fine. What annoy me with this solution is that users can drag and drop dependencies between tasks in the UI. There is no event handler to catch those changes, so a save button should remained. It will bring confusion to user that new tasks are automatically saved but new dependencies are not. For all other action like moving a task, changing the title etc… the event handler TaskEdited works fine.

    Have a good day
    Sebastien



  24. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 12 Aug 2014 Link to this post

    Hi Sebastien,

    When modifying the dependencies between the Tasks in the UI the AddDependency method in the SqlTask class is called - you can save there. You might need to save in RemoveDependency method as well.

    Please test it and let me know if it works.

    Regards,
    Kalin
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  25. Sebastien
    Sebastien avatar
    11 posts
    Member since:
    Jun 2014

    Posted 12 Aug 2014 in reply to Kalin Link to this post

    Hi Kalin,

    Yes it works. My problem is solved. No save button and all actions are directly saved in the database.

    Thanks
    Sebastien

  26. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 13 Aug 2014 Link to this post

    Hello Sebastien,

    I'm glad it helped. If you have any further questions or concerns, please let us know.

    Regards,
    Kalin
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  27. Sebastien
    Sebastien avatar
    11 posts
    Member since:
    Jun 2014

    Posted 11 May 2015 in reply to Kalin Link to this post

    Hi Kalin,

    I'm coming back to the forum with a new question regarding import from Microsoft Project. We would like to have the possibility to import directly from Microsoft Project tasks into our Sql database. On Telerik demo website there is this example :

    http://demos.telerik.com/silverlight/#GanttView/Import

    This example show a method that convert XML from MSProject  into a task list that is an ObservableCollection<GanttTask>();

    Would you have a method to convert XML from MSProject into an ObservableCollection<SqlTask> or would you have a method to convert GanttTask into SqlTask ?

    Best regards

    Sebastien

  28. Polya
    Admin
    Polya avatar
    199 posts

    Posted 12 May 2015 Link to this post

    Hello Sebastien,

    In the mentioned example in MsProjectImportHelper we are generating GanttTasks from the provided xml. Similarly we can generate SqlTask instead of GanttTask as the SqlTask is also an IGanttTask.We should add the missing UniqueId property in the SqlTask class.
    If you wish to convert each GanttTask generated from the MsProjectImportHelper.GetMsTasks() to SqlTask you can use something like that:
    private static Dictionary<GanttTask, SqlTask> generatedTasks = new Dictionary<GanttTask, SqlTask>();
     
    public SqlTask ConvertGanttTaskToSqlTask(GanttTask gTask)
    {
        var sTask = new SqlTask()
        {
            Start = gTask.Start,
            End = gTask.End,
            Title = gTask.Title,
            Deadline = gTask.Deadline,
            UniqueId = gTask.UniqueId,
            Description = gTask.Description,
            Duration = gTask.Duration,
        };
     
        var currentSqlTaskChildTasks = (ObservableCollection<SqlTask>)sTask.Children;
     
        foreach (var childGanttTask in gTask.Children)
        {
            currentSqlTaskChildTasks.Add(this.ConvertGanttTaskToSqlTask((GanttTask)childGanttTask));
        }
     
        sTask.Children = currentSqlTaskChildTasks;
     
        generatedTasks.Add(gTask, sTask);
     
        return sTask;
    }
     
    //After all SqlTasks are Generated we should add their dependencies.
    public void AddSqlDependenciesToGeneratedSqlTask(GanttTask gTask)
    {
        var sTask = generatedTasks[gTask];
     
        foreach (var dependency in gTask.Dependencies)
        {
            sTask.Dependencies.Add(new SqlDependency() { FromTask = generatedTasks[(GanttTask)dependency.FromTask], DependencyType = dependency.Type });
        }
    }

    Hope this helps.

    Regards,
    Polya
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  29. Sebastien
    Sebastien avatar
    11 posts
    Member since:
    Jun 2014

    Posted 12 May 2015 in reply to Polya Link to this post

    Hello Polya,

    Thanks for the very quick reply. We will have a look at this solution.

    Best regards

    Sebastien

  30. AbreuL
    AbreuL avatar
    1 posts
    Member since:
    Nov 2014

    Posted 26 May 2015 in reply to Polya Link to this post

    Hello Polya, my name is Leonel, I'm working with Sebastien in the same project.

    Sometimes when I change dates or add a child task (for example), silverlight exception are thrown, (see attached file), how can I debug that to see errors?

  31. Polya
    Admin
    Polya avatar
    199 posts

    Posted 27 May 2015 Link to this post

    Hi Leonel,

    Are you using Internet Explorer to debug the Silverlight Application. There might be several things that can help you isolate the issue. You can check this article http://www.codeproject.com/Articles/238781/Why-Visual-Studio-Debugger-is-not-working-for-my-S for more information on how to debug Silverlight applications.

    Also if you can isolate the issue in a sample project you can open a support ticket and attach it there so we can investigate it further.

    Regards,
    Polya
    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
Back to Top
UI for WPF is Visual Studio 2017 Ready