Telerik Forums
UI for ASP.NET Core Forum
1 answer
1.8K+ views

I have an editable grid with custom EditorTemplate, the grid has "InLine" edit mode. 

I would like to send a property to this EditorTemplate by using EditorViewData. This property is assigned to the selected row. 

@(Html.Kendo().Grid<VehicleWithTrackerDTO>()
              .Name("VehiclesGrid")              
              .Events(e => e
                    .ExcelExport("excelExport")
                    .BeforeEdit("getColor"))
              .Columns(columns =>
              {
// LOOK AT THE FIRST LINE BELOW:
                  columns.Bound(d => d.ImageId).Title("Image").ClientTemplate("<img src='" + Url.Content("~/imgs/") + "#:Image#'/>").Width(120).Sortable(false).Filterable(false).EditorViewData(new { colorId = 1 });
// colorId = 1 should be replaced with something like #:ColorId#
                  columns.Bound(d => d.Brand).Width(200).Filterable(fb => fb.Multi(true).Search(true));                   
                  columns.Command(command => { command.Edit(); }).Width(100);
              })
              .Editable(editable => editable.Mode(GridEditMode.InLine))           
              .DataSource(source => source
                  .Ajax()
                  .Events(events => events.Error("errorHandler"))
                  .Model(model => model.Id(p => p.DeviceId))
                  .Read(read =>
                  {
                      read.Action("GetVehicles", "Vehicles").Data("searchQuery");
                  })
                  .Update(update => update.Action("Update", "Vehicles"))
              )
      )

My question is how can I send an item with "" property? 

My first idea was to create a javascript function, which will return data like this:

function getColor(e) {
    return {
        colorId: e.model["ColorId"]
    };
}

 

But I can't see the solution to pass this data into EditorViewData method.

 

 

Thanks, 

Mateusz

Stefan
Telerik team
 answered on 21 Sep 2017
1 answer
788 views

I have a data on a server with the CalbelCase formatting for properties. How bind column to model via lambda expression?

This example demonstrates this:

@(Html.Kendo().Grid<WebApplication66.Models.Contact>()
    .Name("Grid")
    .Columns(columns => {
        columns.Bound(m => m.Name);
        columns.Bound(m => m.Price);
    })
    .DataSource(d => d
        .WebApi()
        .Model(model => {
            model.Id(m => m.Key);
            model.Field(m => m.Name);
        })
        .Read(read => read.Action("Get", "Contacts"))
    )
)

My JSON form WebApi controller:

{"data":[{"name":"Test Name","price":100,"key":0},{"name":"Test Name 2","price":1,"key":1}],"total":2,"aggregateResults":null,"errors":null}

Stefan
Telerik team
 answered on 21 Sep 2017
47 answers
740 views
When will you support .NET Core 2.0? I currently cannot use the ToDataSourceResult extension method in my controllers as it depends on an obsolete namespace Microsoft.AspNetCore.Mvc.ModelBinding.ValueProviderResultExtensions.
Bozhidar
Telerik team
 answered on 20 Sep 2017
1 answer
237 views

Hi,

How can I show the category with the value in the tooltip ? I used the template property for this as follows. The template property is not working in the sparkline but  template property is running in the chart.

 @(Html.Kendo().Sparkline<VKSWeb.Models.RasyoAnaliz.RasyoTum>()
                        .Name("turkiye-girisim-sparkline")
                        .Type(SparklineType.Area)
                        .Series(series => series
                            .Line(field => field.TurkiyeGirisimSayisi).Color("\\#639514"))
                        .SeriesDefaults(sd => sd.Line()
                            .Width(2)
                            .Tooltip(tooltip => tooltip.Visible(true)
                                .Format("{0} Adet")
                                .Template("${category} - ${value}")))
                        .CategoryAxis(categoryAxis => categoryAxis
                            .Crosshair(crossHair => crossHair.Visible(true)))
                        .ToClientTemplate())

 

Tsvetina
Telerik team
 answered on 20 Sep 2017
1 answer
674 views

Hello,

I have a Kendo UI Grid and have GridFilterMode.Row enabled. 

My question is; how do i disable autocomplete for my filters? 

Thanks!

 

Georgi
Telerik team
 answered on 19 Sep 2017
1 answer
235 views

Hi there.

Due to some issues in VS2017 I still have to use VS2015. So I have to use VS4MAC if I want to use ASP.NET Core 2.0.

How can I use the Telerik components within Visual Studio for Mac?

Kind regards

Bernd

Bozhidar
Telerik team
 answered on 15 Sep 2017
1 answer
106 views

Grid controls the same data how to merge rows of data like red boxes

please help me

Thank you !~
Stefan
Telerik team
 answered on 15 Sep 2017
2 answers
93 views

Hi guys,

I use the TreeList with dotnet core, but I found a problem the DataSource Model not contain the ParentId property so I can not bind the data.

My version is the internal version 2017.2.823.

Thank you.

Dimitar
Telerik team
 answered on 12 Sep 2017
1 answer
345 views

Hi, 

We have just bought a couple of commercial licenses of Kendo UI for ASP.NET Core MVC after having used the trial version.

I have upgraded my license by removing Telerik.UI.for.AspNet.Core.Trial nuget package and installing Telerik.UI.for.AspNet.Core and left JSand Styles folders which I installed before as I know Telerik distributes the same files through trial and commercial licenses.

My question is under telerik.ui.for.aspnet.core.2017.2.621.commercial folder which I downloaded from our account page there is a nuget package Telerik.UI.for.AspNet.Core.2017.2.621.nupkg. Am I suppose to use this package or what I have done above should be enough to install commercial license. 

Muhammad Irfan

Veselin Tsvetanov
Telerik team
 answered on 12 Sep 2017
1 answer
120 views
Kendo UI implements all the functional features of Web From's RadDropDownTree control 
Checkboxes 
CheckAll and Clear Buttons 
Filtering 
Server-side Templates 
TextMode 
Validation 
http://demos.telerik.com/aspnet-ajax/dropdowntree/examples/overview/defaultcs.aspx
Stefan
Telerik team
 answered on 07 Sep 2017
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?