Razor Syntax

6 posts, 0 answers
  1. Jason
    Jason avatar
    9 posts
    Member since:
    Jan 2009

    Posted 06 Aug 2014 Link to this post

    I haven't seen any documentation on razor syntax for the Gantt control. Is this somewhere? I am trying to do the following:

    @(Html.Kendo().Gantt(Model) // Bind the grid to the Model property of the view
            .Name("Gannt")
            .Columns(columns => columns.Bound(o=>o.Title).Title("Title"))
            )

    And I'm receiving the following error: CS1501: No overload for method 'Gantt' takes 1 arguments

    In looking at the ASPX example here: http://docs.telerik.com/kendo-ui/api/wrappers/aspnet-mvc/Kendo.Mvc.UI.Fluent/GanttColumnBuilderBase

    <%= Html.Kendo().Gantt(Model)
    .Name("Gantt")
    .Columns(columns => columns.Bound(o => o.OrderID).Title("ID"))
    %>

    It looks like the only parameter is the Model itself. This is probably something silly that I'm missing. Any help is greatly appreciated.






  2. Bozhidar
    Admin
    Bozhidar avatar
    1102 posts

    Posted 08 Aug 2014 Link to this post

    Hi Jason,

    I confirm that at the moment there is no documentation for the Gantt MVC wrapper, however you could use our online demos to guide you in setting up your gantt:
    http://demos.telerik.com/aspnet-mvc/gantt/index

    We'll do our best to include the missing documentation articles as soon as we can.

    Regards,
    Bozhidar
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Jason
    Jason avatar
    9 posts
    Member since:
    Jan 2009

    Posted 08 Aug 2014 in reply to Bozhidar Link to this post

    Thanks, Bozhidar! 

    I saw that demo, and it was helpful. One thing that I'm not clear on is what the control is looking for in the parameters: Html.Kendo().Gantt<Kendo.Mvc.Examples.Models.Gantt.TaskViewModel, Kendo.Mvc.Examples.Models.Gantt.DependencyViewModel>. 

    Do you know if there is a similar, non-MVC implementation of a Gantt control that might explain what these passed objects should look like?

    I downloaded the local samples, complied the solution, and went through the code on these ViewModels (TaskViewModel and DependencyViewModel), but I'm still not sure what the purpose is of the DependencyViewModel.

    Just a high level overview of what these objects are used for would probably be all that I need.

    Thanks!
    Jason

  5. Richard
    Richard avatar
    18 posts
    Member since:
    Jun 2014

    Posted 11 Aug 2014 in reply to Jason Link to this post

    Hi,

    You can see the structure of the Dependency viewmodel in the example at http://demos.telerik.com/aspnet-mvc/gantt/index

    .DependenciesDataSource(d => d
        .Model(m =>
        {
            m.Id(f => f.DependencyID);
            m.PredecessorId(f => f.PredecessorID);
            m.SuccessorId(f => f.SuccessorID);
            m.Type(f => f.Type);
        })

    The dependencies model determines the 'arrows' on the Gantt chart (that go from the end of one task to the beginning of another).  These arrows represent the dependencies (ie for each task id:id what task(s) has an arrow pointing to this task (predecessor), and which other task(s) does this task point to.  

    I have to admit I have no idea what 'Type' property is used for.

    I am experimenting at the moment with using an empty Dependencies viewmodel as I don't need any arrows at this point.
  6. Bozhidar
    Admin
    Bozhidar avatar
    1102 posts

    Posted 11 Aug 2014 Link to this post

    Hi Richard,

    The type of the Dependency is a number between 0 and 3, which determines whether the dependency is:
    0 - Finish to Finish
    1 - Finish to Start
    2 - Start to Finish
    3 - Start to Start

    More details about each of these types can be found here:
    http://www.gantt.com/creating-gantt-charts.htm

    Another example of the types paired with screenshots for clarity can be found in our ASP.NET documentation for the RadGantt, which uses the kendo Widget internally:
    http://www.telerik.com/help/aspnet-ajax/gantt-structure-dependencies.html 

    We will also update the documentation to include a more detailed explanation of this property.

    Regards,
    Bozhidar
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  7. Jason
    Jason avatar
    9 posts
    Member since:
    Jan 2009

    Posted 11 Aug 2014 in reply to Bozhidar Link to this post

    Thanks for the help! I too will experiment with the empty Dependencies viewmodel for now. 
Back to Top
UI for ASP.NET MVC is VS 2017 Ready