Telerik Forums
UI for ASP.NET Core Forum
1 answer
237 views

Hello i was just curious if there is any difference between html validation vs tag helper validation.? I am using the basic template that kendo provides to create a new project and i have observed the differences that by default html helper project provides validation but tags option doesn't create validation .Am i missing anything?

 

 

 

 

 

 

Mihaela
Telerik team
 answered on 03 Aug 2023
1 answer
534 views

How do you change the backcolor of the box where the checkmark is made?  This is not the control backcolor, but the color inside the checkbox.

In this link it is called RadCheckMark checkPrimitive (1.1) https://docs.telerik.com/devtools/winforms/controls/buttons/checkbox/structure

I can't find any property that controls that checkPrimitive back color.

 

Stoyan
Telerik team
 answered on 02 Aug 2023
1 answer
193 views

I  Created a simple  employee auto complete inside a grid i have the following code 

in grid

@(Html.Kendo().Grid<DI_IPMS_KENDO.Models.AdminViewModel>()
    .Name("grid")
    .Columns(columns =>
    {
        columns.Bound(p => p.EmployeeName).EditorTemplateName("AdminEmp");
        columns.Bound(p => p.Team).Width(100);
        columns.Bound(p => p.Notification).Width(100);
        columns.Bound(p => p.Approval).Width(100);
        columns.Command(command => { command.Edit(); command.Destroy(); }).Width(200);
    })
    .ToolBar(toolbar => toolbar.Create())
    .Editable(editable => editable.Mode(GridEditMode.InLine))
    .Pageable()
    .Sortable()
    .Scrollable()
    .HtmlAttributes(new { style = "height:430px;" })
    .DataSource(dataSource => dataSource
        .Ajax()
        .PageSize(20)
        .Events(events => events.Error("error_handler"))
        .Model(model => model.Id(p => p.AdminInfoID))
        .Create(update => update.Action("Admin_Create", "Home"))
        .Read(read => read.Action("Admin_Read", "Home"))
        .Update(update => update.Action("Admin_Update", "Home"))
        .Destroy(update => update.Action("Admin_Destroy", "Home"))
    )
)

editor template has 

                                                

@model string;

<script src="https://cdn.kendostatic.com/2023.2.606/js/jquery.min.js"></script>

<script>



    function onAdditionalData(e) {


            return {

                Empltext: e.filter.filters[0].value

            }


        }




</script>
<div>
    @(Html.Kendo().AutoComplete()
      .Name("EmployeeName")
        .Filter("startswith")
        .MinLength(4)
        .Placeholder("Search for Employee")
        .DataTextField("FullName")             
        .HtmlAttributes(new { style = "width:50%" })
        .DataSource(source =>
        {
            source
            .Read(read =>
            {
                read.Action("EmpSearchData", "Home")
            .Data("onAdditionalData");
            })
            .ServerFiltering(true);
        })
        )


</div>

 

The problem is autoserach works great when i serach but when i click on  'x' clear then it hangs :(. What  am i doing wrong

 

 

 

 

 

Alexander
Telerik team
 answered on 02 Aug 2023
1 answer
167 views

I have a grid child template that consists of a data source and several charts referencing that data source. It is a mystery to me how you are supposed to reference the 'data' context in different scenarios.

After much trial and error I got the url and filter value on the data source to resolve successfully.

But with these nothing seems to work...

The 'name' attribute on kendo-datasource just renders literally as 'ds-${data.DeviceId}'

Same with the 'datasource-id' attributes on the charts.

Tried variants on wrapping in @() but am getting nowhere. Very confusing and seems the only documentation is this example:

Integration with Grid in ASP.NET Core Template Component Demo | Telerik UI for ASP.NET Core


<grid-detail-template> <kendo-datasource name="ds-${data.DeviceId}" type="DataSourceTagHelperType.Ajax" server-filtering="true" is-in-client-template="true"> <transport> <read url="@Html.Raw("/Devices/Diagnostics/${data.DeviceId}?handler=Read")" type="post" data="forgeryToken" /> </transport> <filters> <datasource-filter logic="and"> <filters> <datasource-filter field="DeviceId" operator="eq" value="@("${data.DeviceId}")"></datasource-filter> <datasource-filter field="LogDate" operator="gt" value="@DateTime.Today.AddMonths(-1)"></datasource-filter> </filters> </datasource-filter> </filters> <schema> <model> <fields> <field name="DeviceId" type="number" /> <field name="LogDate" type="date" /> </fields> </model> </schema> </kendo-datasource> <kendo-chart name="memChart" theme="Bootstrap" datasource-id="ds-${data.DeviceId}">

</kendo-chart>


 

Mihaela
Telerik team
 answered on 01 Aug 2023
1 answer
211 views

In the latest release, 23.1.4, a Date time picker with the DateInput option set fails to be initialized with a jQuery error "s is not a constructor".

This occurs in my code and when using the example from the demo pages https://demos.telerik.com/aspnet-core/datepicker/basic-usage

TagHelper:

<kendo-datepicker name="monthpicker" date-input="true" format="MMMM yyyy" value="DateTime.Now" start="CalendarView.Year" depth="CalendarView.Year" name="monthpicker" style="width: 100%" title="monthpicker">
        </kendo-datepicker>

HtmlHelper:

@(Html.Kendo().DatePicker() .Name("monthpicker") .Start(CalendarView.Year) .Depth(CalendarView.Year) .Format("MMMM yyyy") .Value("November 2011") .DateInput() .HtmlAttributes(new { style = "width: 100%", title = "monthpicker" }) )

 

Both of the above fail to be initialized with the same error. JQuery version 3.3.1 is being used in this case.

Gordon

Mihaela
Telerik team
 answered on 31 Jul 2023
1 answer
224 views

Hi, Recently I started migrating a .Net MVC project with Kendo to .Net Core MVC. Most of the things went smooth but I'm badly stuck on one thing.

Below is my code where I have a Kendo tabstrip that has three tabs. The last two has Html.Partial in their Content which is working fine. The First one has @RenderSection("HomeTab", false) which I can't get to work. Doesn't RenderSection work with .Net Core MVC?

I have tried removing all of my code and tried just adding a test div inside this section but nothing works. If I move the content of my HomeTab section to another view and try Html.Partial it works but RenderSection doesn't. The tabstrip is inside a Layout page and the content of the HomeTab section is in a different view that also have other sections that are rendering completely fine. I'm badly stuck in this and need help please.

section id="main" class="PageSection">
            @(Html.Kendo().TabStrip()
        .Name("tabstrip")
        .Events(events => events
            .Select("onTabSelected")
            .Activate("onTabActivated")
            .ContentLoad("onTabContentLoaded")
            .Error("onTabError")
        )
        .Animation(animation =>
        {animation.Enable(false);})
        .Items(tabstrip =>
        {
            if (!ViewBag.isOffline)
            {
                tabstrip.Add().Text("Home")
                .HtmlAttributes(new { id = "hometabid" })
                .Selected(true)
                .ImageUrl(Url.Content("~/Content/Images/HomeTabIcon.png")).ImageHtmlAttributes(new { id = "hometabimgid" })
                .Content(@<text>
                            @RenderSection("HomeTab", false)
                        </text>).ContentHtmlAttributes(new { @style = "overflow: auto;" });
            }
            tabstrip.Add().Text("Lead Search")
                .HtmlAttributes(new { id = "LeadSearchtabid" })
                .Selected((bool)ViewBag.isOffline).ContentHtmlAttributes(new { @style = "overflow: auto;" })
                .ImageUrl(Url.Content("~/Content/Images/search-lead-icon.png")).ImageHtmlAttributes(new { id = "leadsearchtabimgid" })
                .Content(@<text>
                    @Html.Partial("LeadSearching")
                </text>);
           if (ViewBag.isOffline)
            {
                tabstrip.Add().Text("VoiceMail")
                .HtmlAttributes(new { id = "vmtabid" })
                .Selected(false)
                .ImageUrl(Url.Content("~/Content/Images/HomeTabIcon.png")).ImageHtmlAttributes(new { id = "hometabimgid" })
               .Content(@<text>
                            @Html.Partial("VoiceMail")
                </text>).ContentHtmlAttributes(new { @style = "overflow: auto;" });
            }
        }))
            @RenderBody()
            <div id="dvNotification"></div>
        </section>

Aleksandar
Telerik team
 answered on 31 Jul 2023
1 answer
99 views

Hello, I've tried to search online and in this forum for this, but I've not found anything useful.

 

How can the header row for Grids be made resizable?

Currently all our grids have resizable columns, but sometimes texts are very long which make the header very high, for this cases we need that users are able to resize the header vertically.

 

Thanks in advance

Vasko
Telerik team
 answered on 28 Jul 2023
1 answer
213 views

I am using a drop down list in column template inside a grid..I could save sucessfully but when i click on edit the dropdown losses its bind.Can any one help  with what i am missing

   <kendo-dropdownlist name="Team"
                                        datatextfield="Team"
                                        datavaluefield="TeamID" data-bind="value:Team">
                        <datasource>
                            <transport>
                                <read url="@Url.Action("Teams_Read", "Grid")" />
                            </transport>
                        </datasource>
                    </kendo-dropdownlist>

 

i chnaged name of the dropdown to the value of what i wante dto bind but it didnt work.

Vasko
Telerik team
 answered on 28 Jul 2023
1 answer
270 views

HI

I have a grid with row reorder enabled in bootstrap 4 pop up modal. 

I can drag the row but cannot drop the row to another position., It works outside of modal. 

Can I know is there anything extra to set or need a hack to allow the dropping of row to reorder them?

My code below:

Note: Datasource is set on document ready script.

<div class="modal fade" id="ServiceDetailModal" role="dialog" aria-labelledby="ServiceDetailModalLabel" aria-hidden="true" data-backdrop="static" data-keyboard="false">
    <div class="modal-dialog" role="dialog">

        <form id="ServiceDetailModalForm" autocomplete="off" >

            <div class="modal-content">

                <div class="modal-header pb-0">
                    Services Detail
                </div>
                <div class="modal-body">

@(
Html.Kendo().Grid<DSPJobServiceItems>()
.Name("modalServiceDetail_ServiceFeeItem")
.Editable(editable => editable.Mode(GridEditMode.InCell))
.Navigatable(true)
.Reorderable(r => r.Rows(true))
.Events(e => e.Edit("ServiceFeeEdit").RowReorder("modalServiceDetail_ServiceFeeItemRowReorder"))
.Columns(columns =>
{
columns.Template("").Width(50).Draggable(true); 
columns.Bound(p => p.GeneralServiceTitle).Title("Service Item");
})
)

</div>

                <div class="modal-footer">
                    <button type="button" class="k-button btn-danger">Close</button>
                </div>
            </div>
        </form>
    </div>
</div>
Alexander
Telerik team
 answered on 27 Jul 2023
1 answer
182 views

This is my grid:

@(Html.Kendo().Grid<Project>()
    .Name("ProjectsGrid")
    .Columns(columns =>
    {
        columns.Bound(p => p.ProjectName)
            .ClientTemplate("<a href=/Directory/project/${Id} target=_blank>${ProjectName}</a>")
            .Width(180);
        columns.Bound(p => p.ProjectManager).Width(230)
            .ClientTemplate("#=data.ProjectManager?.Name#")
            .EditorTemplateName("WorkingEmployee")
            .Sortable(s => s.Compare("(a, b) => compareManager(a, b)"));
        columns.Bound(p => p.IsActive)
            .Width(180)
            .ClientTemplate("#: IsActive ? 'Yes' : 'No' #");
    })
    .ToolBar(toolbar =>
    {
        toolbar.Save();
        toolbar.Search();
    })
    .Search(s =>
    {
        s.Field(e => e.IsActive);
        s.Field(e => e.ProjectName, "contains");
    })
    .Sortable()
    .Editable(GridEditMode.InCell)
    .DataSource(dataSource => dataSource
        .Ajax()
        .Batch(true)
        .ServerOperation(false)
        .Events(events => events.Error("error_handler"))
        .Model(model =>
        {
            model.Field(p => p.ProjectManager).DefaultValue(
                ViewData["defaultProjectManager"] as User);
            model.Field(p => p.ProjectName).Editable(false);
        })
        .Read("Projects_Read", "Directory")
        .Update("Projects_Update", "Directory")
    ))

 

With "s.Field(e => e.ProjectName, "contains");" it throws:

 

Uncaught TypeError: e.charAt is not a function kendo.all.js:2114

 

Without this, it runs correctly.

 

Additional question

Also, I would like to know how to search for value of bool variable. The variable is shown as yes, no words. When I search for no, it should show me records where value is false. How to implement this?

Stoyan
Telerik team
 answered on 25 Jul 2023
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?