Telerik Forums
UI for ASP.NET MVC Forum
2 answers
91 views

i want to check condition before save   but still not work what im wrong ?

how to solve it

<p>save: Function(e) {</p><p>var currenVar = e.model.id;</p><p>var data;;</p><p>https.get($scope.service URL + currenVar.success(function (result){</p><p>data= result;</p><p>for (item in data){</p><p>if(data[item].id == currenVar  {</p><p>alert('Cannot use this');</p><p>e.preventdefault();</p><p>}</p><p>}</p>
Tsvetina
Telerik team
 answered on 22 Nov 2018
1 answer
3.9K+ views
I was going great with the web project, until i found this issue, if i use the dropdownlist outside of the grid, it will display just fine, even if i assign it to the toolbar template, but when i assign it to grid's pop-up editor, it doesn't display the dropdownlist for me to create a new data, it just displays the blank text, can someone explain to me how to use dropdownlist in editor, i tried the custom editor but it doesn't help.
Georgi
Telerik team
 answered on 21 Nov 2018
6 answers
283 views

Hi,

I have a scatter line chart that is supposed to show incidents that occur simultaneously. I am almost there, but have some issues I haven't been able to solve:

1) The color of the lines and markers should all be the same. As it is the color seems to be random.

2) Same goes for the tooltip, as you can see some color combinations makes for very poor visibility. I have tried to set .Color("white") on the tooltip, but it has no effect.

3) Is it possible to set the size of the chart depending on the amount of data? If there are many simultaneous incidents the chart needs to be higher.

4) I would like to have labels instead of tooltips, labels that looks like the toopltips I get when hovering over a line, but they should always be visible for all lines.Is this possible?

Best regards,

Henrik

Henrik
Top achievements
Rank 1
 answered on 20 Nov 2018
1 answer
100 views
Hi, i’m trying to connect an OLAP cube in Azure Analisys Services to the pivot grid, but there is no dll for HTTP connection, how can i do this?

Thank you
Konstantin Dikov
Telerik team
 answered on 20 Nov 2018
5 answers
1.7K+ views
Hi,

I have the grid below and I have added a dropdown list in one of the cells. What I want to do is for each item in the dropdown list I want to set a color.

I.e. item 1 has a blue background, item 2 has a green background etc.

Also I want the selected items background color to also be the same as the item they have selected.

Any Ideas on what I can do to achieve the above?

Below is the grid I am working with:

@using System.Collections.Generic;

@model IEnumerable<TelerikChecklist.Models.ProductViewModel>
    
@(Html.Kendo().Grid(Model)
    .Name("gridDropDown")
    .Columns(columns =>
    {
        columns.Bound(p => p.ProductName);
        columns.ForeignKey(p => p.CategoryID, (System.Collections.IEnumerable)ViewData["categories"], "CategoryID", "CategoryName")
            .Title("Category").Width(150);
    })
    .Editable(editable => editable.Mode(GridEditMode.InCell))
    .Pageable()
    .Scrollable()
    .HtmlAttributes(new { style = "height:250px;" })
    .DataSource(dataSource => dataSource
        .Ajax()
        .Batch(true)
        .PageSize(20)
        .ServerOperation(false)
        .Events(events => events.Error("errorHandler"))
        .Model(model =>
        {
            model.Id(p => p.ProductID);
            model.Field(p => p.ProductID).Editable(false);
            model.Field(p => p.CategoryID).DefaultValue(1);
        })

        .Read(read => read.Action("ForeignKeyColumn_Read", "Home"))
        .Update(update => update.Action("ForeignKeyColumn_Update", "Home")).Events(e => e.Change("Category"))
        .Create(create => create.Action("ForeignKeyColumn_Create", "Home"))
        .Destroy(destroy => destroy.Action("ForeignKeyColumn_Destroy", "Home"))

    )
    )

Dimitar
Telerik team
 answered on 19 Nov 2018
3 answers
1.3K+ views

How can I get the original values of the row when calling an update function?

My main issue is that we have a few tables where the primary key is a value we allow to be changed. However, the default auto-generated update functions will fail on update if that value is changed in the grid editor because it won't be able to lookup the row you're updating since it only knows what you want to change the value to and tries to look the row up by the new value.

How can we handle this situation?

Konstantin Dikov
Telerik team
 answered on 16 Nov 2018
5 answers
358 views
I am just wondering how to access the buttons that allow you to choose either to edit the current recurrence or edit the entire recurrence series. I would like to call a function when one of them is clicked. I have attached a picture of the buttons for your convenience.
Veselin Tsvetanov
Telerik team
 answered on 16 Nov 2018
10 answers
1.4K+ views

Hi there - apologies if this is elsewhere, but I've searched and can't find an answer. I have good C# experience, but I'm relatively new to Telerik/Kendo etc,

I am aware of the AllPages(true) option for the Excel printout. What I would like to do on my Grid is to have two excel buttons, one that will export the current page, and one which will export all data.

Is this possible? From what I can see, you can only define one Excel Button on the toolbar.

Thanks in advance.
Eyup
Telerik team
 answered on 15 Nov 2018
3 answers
868 views

I'm trying the grouping in Grid I want to display the sum of the column as ClientGroupHeaderColumnTemplate  or ClientHeaderTemplate but doesn't  seem to be working, it only shows as a ClientFooterTemplate. :

@(Html.Kendo().Grid<Models.DepartmentSummaryView> ()
        .Name("grid")
        .HtmlAttributes(new { style = " height:700px !important;" })
        .Columns(columns =>
        {
            columns.Bound(p => p.DepartmentNo).Width(150).ClientGroupHeaderTemplate("Department: #= value # (Products: #= count#)");
            columns.Bound(p => p.DepartmentName).Width(150).ClientGroupHeaderTemplate("Department: #= value # (Products: #= count#)");
            columns.Bound(p => p.ProductNo).Width(150).ClientGroupHeaderTemplate("Product: #= value # (Count: #= count #)");
            columns.Bound(p => p.ProductName).Width(150);
            columns.Bound(p => p.SKU).Width(150);
            columns.Bound(p => p.Qty).Width(150).ClientGroupHeaderColumnTemplate("Sum: #= sum #").ClientFooterTemplate("Sum: #= sum #");
        })
        .Filterable(filterable => filterable.Extra(false)
        //.Mode(GridFilterMode.Row)
        .Operators(operators => operators
        .ForString(str => str.Clear()
        .StartsWith("Starts with")
        .EndsWith("Ends with")
        .IsEqualTo("Is equal to")
        .IsNotEqualTo("Is not equal to")
        .Contains("Contains")
        .DoesNotContain("Doesn't contain")
        )))
        //.Pageable()
        .Navigatable()
        .AutoBind(false)
        .Sortable()
        .Groupable()
        .Events(events => events.DataBound("onDataBound"))
        .Reorderable(reorderable => reorderable.Columns(true))
        .DataSource(dataSource => dataSource
        .Custom()
        .Schema(schema =>
        {
            schema.Data("Data");
            schema.Total("Total");
        })
        .Events(events => events.Sync("sync_handler"))
        .Group(groups => groups.Add(p => p.DepartmentNo))
        .Aggregates(aggregates =>
        {
            aggregates.Add(p => p.DepartmentNo).Count();
            aggregates.Add(p => p.DepartmentName).Count();
            aggregates.Add(p => p.ProductNo).Count();
            aggregates.Add(p => p.SKU).Count();
            aggregates.Add(p => p.Qty).Sum();
        })
        .Transport(transport =>
        {
 
            transport.Read(read =>
                read.Url("/api/enquiries/departmentsummary)
                .DataType("json")
 
                .Type(HttpVerbs.Get)
                );
                            transport.Create(create =>
                create.Url(Base.APIHostAddress + "/api/enquiries/post")
                .DataType("json")
                .Type(HttpVerbs.Post)
                .ContentType("application/json; charset=utf-8")
 
                );
                        
                transport.ParameterMap("parameterMap");
        })
        )
)

 

Konstantin Dikov
Telerik team
 answered on 15 Nov 2018
1 answer
214 views

I have got a problem where my grid columns expect a detailed name ("CityFrom" and "CityTo" - those are strings), but a method returns "Name" property. How can I map the result to the columns without duplicating the code?

Here is grid:

@(Html.Kendo().Grid<RouteDto>()
.Name("route-grid")
.Columns(cfg =>
{
    cfg.Bound(m => m.CityFrom)
    .Title("City From")
    .Width(150)
    .Filterable(f =>
        f.Multi(true).DataSource(ds =>
            ds.Read(r =>
                r.Action("GetCities", "City")
            )
        )
    );
    cfg.Bound(m => m.CityTo)
    .Title("City To")
    .Width(150)
    .Filterable(f =>
        f.Multi(true).DataSource(ds =>
            ds.Read(r =>
                r.Action("GetCities", "City")
            )
        )
    );
}))

 

Here is method:

public ActionResult GetCities()
{
    var cities = _cityService.GetCities().Select(c => new { c.Name }).ToList();
    return Json(cities, JsonRequestBehavior.AllowGet);
}

Error I am getting is in console:

Uncaught ReferenceError: CityFrom is not defined
Uncaught ReferenceError: CityTo is not defined

 

On grid I could use .DataTextField("Name"), but I don't have this option here. Both filters have got the same set of values - cities from database. Any ideas what can I do elegantly here?

Georgi
Telerik team
 answered on 15 Nov 2018
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?