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

Change datasource type with Mvc wrapper

1 Answer 97 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Luciano Kaesemodel
Top achievements
Rank 1
Luciano Kaesemodel asked on 24 Nov 2014, 06:01 PM
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

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 26 Nov 2014, 04:42 PM
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.

 
Tags
Grid
Asked by
Luciano Kaesemodel
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or