Telerik Forums
UI for ASP.NET MVC Forum
1 answer
168 views

HTML


<input type="checkbox" id="chkShowPopEventDay" />

JavaScript


$("#chkShowPopEventDay").kendoCheckBox({
    label: "ShowPopEventDay",
    checked: true,
});

 

I tried to use the check box by referring to the address, but the message appears as follows. Is there anything wrong?

Reference URL: https://demos.telerik.com/kendo-ui/checkbox/index

 

Martin
Telerik team
 answered on 01 Nov 2022
0 answers
109 views

I have an app thats working with SignalR grids, but now we want to add bearer auth.

The token handling stuff has to happen before my SignalR promise is set, but the problem is the Kendo components required the SignalR promise to bind.

How can I set a SignalR promise that the Kendo components can use which will not resolve until my own token handling functions are complete?

Here is a sample of what we're doing:


getTokenPopup({
                scopes: ["api://918c95d7-8c39-4486-9e15-83d061a30fa6/access_as_user"]
            })
                .then(response => {
                    $.ajaxSetup({
                        beforeSend: function (xhr) {
                            xhr.setRequestHeader('Authorization', 'Bearer ' + response.accessToken);
                        }
                    });

                    myApp.hub = $.connection.searchHub;
                   myApp.hubStart = $.connection.hub.start({
                      waitForPageLoad: false,
                      transport: "longPolling"
                    });
                })
                .catch(error => {
                    console.error(error);
                });

iCognition
Top achievements
Rank 1
Iron
 asked on 31 Oct 2022
1 answer
94 views

 

Open the search box. The default condition is fuzzy query, not equal to

Karina
Telerik team
 answered on 28 Oct 2022
1 answer
275 views

If I have the following piece of code on a cshtml view

<div>
    @{ Html.BeginForm("test"); }
</div>
@Html.Kendo().NumericTextBox().Name("kendo")
<input name="native" type="text" />
<button type="submit">go</button>
@{ Html.EndForm(); }

When I submit the form, the native input value is on the form data, but not the kendo one.
If I remove the div around the BeginForm, it will submit.

Html.EditorFor controls also include their values on the form data, even on the case of incorrectly closed form tags.

Is this by design? If so, it should be documented as it is different than the native behavior.
If not, then it should be aligned with the native behavior.

Using Kendo.MVC 2022.3.913.545

Yanislav
Telerik team
 answered on 28 Oct 2022
1 answer
105 views
I'm wanting to create a column where I list the grid lines by numbers in ascending order and not by id, is it possible?


Yanislav
Telerik team
 answered on 27 Oct 2022
1 answer
91 views

 

I filled in the G2 unable to trigger formula. Who can tell me

Karina
Telerik team
 answered on 26 Oct 2022
1 answer
109 views

Model for the Tag property is of complex type object 


 [UIHint("TaskTagEditor")]
 public List<NameId> TaskTags { get; set; }

// Class ----

    public class NameId
    {
        public int Id { get; set; }
        public string Name { get; set; }

    }

Kendo grid field: 


    columns.Bound(p => p.TaskTags).Width(240).ClientTemplate("#=taskTagsTemplate(TaskTags)#").EditorTemplateName("TaskTagEditor").Title("Tasks")
                                                        .Filterable(p => p.Multi(true)
                                                                    .CheckAll(false)
                                                                    .ItemTemplate("TaskTagsFilterItemTemplate")
                                                                    .DataSource(d =>
                                                                    {
                                                                        d.Read(read => read.Action("GetTaskTagsEditor", "TaskManager"));
                                                                    })
                                                    );

 

Client Template and Item template js:


    function taskTagsTemplate(data) {
        var template = "";
        for (var i = 0; i < data.length; i++) {
            template += (data.length == 1 || i == 0) ? data[i].Name : ("," + data[i].Name);
        }
        return template;
    }

    function TaskTagsFilterItemTemplate(e) {
        return "<span><label><input class='tag-filter-input' type='checkbox' name='" + e.field + "' value='#= Id #'/><span>#= Name #</span></label></span><br/>"
    }

 

Editor :

GetTaskTagsEditor


@model List<GrapeTree.Core.Model.TaskManager.NameId>

@(Html.Kendo().MultiSelectFor(m => m)
        .DataTextField("Name")
        .DataValueField("Id")
        .AutoBind(false)
        .TagMode(MultiSelectTagMode.Multiple)
        .DataSource(d =>
                {
            d.Read(read => read.Action("GetTaskTagsEditor", "TaskManager"));
        })
)

Controller method for option:


        public ActionResult GetTaskTagsEditor() {

            var tagList = _taskManager.GetActiveTaskTags()
                 .Select(tag => new NameId
                 {
                     Id = tag.Id,
                     Name = tag.Name

                 }).OrderBy(x => x.Name);

            var jsonSerializerSettings = new JsonSerializerSettings { ContractResolver = new DefaultContractResolver() };
            var json = JsonConvert.SerializeObject(tagList.ToList(), Formatting.Indented, jsonSerializerSettings);

            return Content(json, "application/json");
        }

Incell Editor is working fine  and Filter about to bind with muti select value but filtering doesn't work for this complex object

Milena
Telerik team
 answered on 24 Oct 2022
1 answer
132 views

Hi ,

We have a validation related requirement on the datepicker control. The datepicker control should not allow alphabets or special chars to be keyed in.  It should allow only numerics, backspace and forward slaces keys for example: 10/10/2022. 

The requirement is to validate it as soon as its keyed in instead of when the control lose focus.

Because datepicker control does not have keydown/key press event, I added a jquery script as below and it works fine but we dont want to repeat the script for all the date pickers controls on different screens across the project. Is there any feature of the control it self that can be used everywhere??

 

Thanks,

Chhavi

Eyup
Telerik team
 answered on 21 Oct 2022
1 answer
158 views

I have a grid that I want to be an Ajax grid (not Server) but I need to render one of the cells using ASP.NET MVC partials. Looks somewhat like this:


@(Html.Kendo().Grid(Model.Items)
            .Name("items")
            .Columns(columns =>
            {
                columns.Bound(p => p.Payload).Template(@<text>
                    @Html.Partial(item.ItemUI, item.Payload)
                </text>).ClientTemplate("@output");
            })
    .DataSource(dataSource => dataSource
        .Ajax()
    )
)

Is that possible to instruct Kendo to output the result of a call to Template() in ClientTemplate()? In the example above, is there some magic keyword I can use instead of the highlighted @output to say "output whatever was generated on the server side here?"

Thanks

Ivan Danchev
Telerik team
 answered on 19 Oct 2022
1 answer
115 views

I have a partial MVC view called _user.cshtml that displays some basic information about a user:

@model UserVM
<p>
    <span>Name: </span>@Model.Name
    <span>Email: </span>@Model.Email
</p>

In the parent view I have an MVC Kendo Grid:

@model ImportUsersVM
@(Html.Kendo().Grid(Model.Items)
    .Name("ImportUsers")
        .Columns(columns =>
        {
            columns.Bound(i => i.Status);

            columns.Template(i => Html.RenderPartial("_user", i.Payload));
        })
        .DataSource(dataSource => dataSource
            .Ajax()
            .PageSize(100)
            .ServerOperation(false)
        )
)

The highlighted line above doesn't work -- the user information is not rendered.

How can I include an MVC partial on each row of the grid?

Thank you

 

Ivan Danchev
Telerik team
 answered on 19 Oct 2022
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?