Change datasource type with Mvc wrapper

2 posts, 0 answers
  1. Luciano Kaesemodel
    Luciano Kaesemodel avatar
    29 posts
    Member since:
    Apr 2007

    Posted 24 Nov 2014 Link to this post

    Hello...

    I have a Ajax grid, like that :

    @(Html.Kendo().Grid<EmployeeVM>().Name("grid")
      .Columns(columns =>  {
          columns.Bound(model => model.Id).Hidden(true);
          columns.Bound(model => model.First);                              
          columns.Bound(model => model.Email);                          
       })
       .Groupable(y => y.Enabled(true))
       .Sortable(x => x.SortMode(GridSortMode.MultipleColumn))
       .Pageable(x => x.PageSizes(true).Messages(messages => messages.Empty("")))
       .DataSource(dataSource => dataSource
          .Ajax()     
          .PageSize(10)
          .Model(model => model.Id(p => p.Id))
          .Read(read => read.Action("List", "Employee").Type(HttpVerbs.Post)))


    The javascript generated included the datasource type 'aspnetmvc-ajax':
    ...
    "dataSource":{"type":(function(){if(kendo.data.transports['aspnetmvc-ajax']){return 'aspnetmvc-ajax';} else{throw new Error('The kendo.aspnetmvc.min.js script is not included.');}})()
    ...

    I dont want that. I´d like to takeoff that type. 
    How can I change/takeoff the automatic type generated?

    Ty
  2. Daniel
    Admin
    Daniel avatar
    2231 posts

    Posted 26 Nov 2014 Link to this post

    Hello,

    You can use the DataSource Custom builder:
    .DataSource(dataSource => dataSource
        .Custom()
        ...
    if you do not wish to use the default dataSource type for the wrapper.

    Regards,
    Daniel
    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.

     
Back to Top