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

https://demos.telerik.com/aspnet-core/grid/hierarchy?_gl=1*j684iw*_gcl_au*NzkwOTcxNzM0LjE3MzI2ODQyMjI.*_ga*NDI2MDIyNDE3LjE3MDM2NjI4NTM.*_ga_9JSNBCSF54*MTczMzEyMTgzOC42LjEuMTczMzEyNzMwNy40Ny4wLjA.

 

I have build my parent child table grid by referring above link. Still i need to have check box for each row just like checkbox tree. 

For that i need to bind my child row id in template, I tried as below. 

columns.Bound(o => o.ChildAppointmentID).Width(50).ClientTemplate("#= childCheckbox(OrderId) #");

Issue is:

At runtime, it is trowing error from child table by saying that it can not bind "OrderId" (No order id is not found).

Further i found out, This template only able to bind the date from parent data source only.

 

 

 

Eyup
Telerik team
 answered on 02 Dec 2024
1 answer
75 views

Hi, I'm using UI ASP.Net core to display some data on a grid. On one of the grid column I need a filter with multi-checkbox and search. I'm doing this by the following code on the view:

columns.Bound(c => c.Affects).Title("Components").ClientTemplate("#=showComponents(data)#").Groupable(false).Width(180).Hidden(true)
    .Filterable(fb => fb.Multi(true).CheckAll(true).Search(true).ItemTemplate("filterComponentsTemplate")
        .DataSource(ds => ds.Read(r => r.Action("GetComponentsNamesForGridFilter", "Changes"))));

My problem is than the list of components is very very big and I get performance issue on the initial load of the filter menu. I would like to limit the number of components to be displayed to 100 and refresh the list every time a key is pressed on the Search textbox.

How to do that? I cannot find a way to handle events from the filter search textbox.

Ivaylo
Telerik team
 answered on 01 Nov 2024
0 answers
45 views

Hello,

Im using angular 16 and .net core 7 version. When i send request to back-end, i can handle. But i have a problem.

Let's assume we have two tables: roles and users. In Angular, there's a grid where I display the roles. I'm having issues on the backend side when applying filtering in that grid.

 <kendo-grid-column [width]="300" title="Rol" [sortable]="cantFilterandSort" field="Roles">
            <ng-template kendoGridFilterCellTemplate let-filter let-column="column">
                <kendo-multiselect [checkboxes]="true" [autoClose]="false" [tagMapper]="tagMapper"
                    [data]="this.roleList" textField="name" valueField="idx"
                    [valuePrimitive]="true"  (valueChange)="onRoleFilterChange($event)"></kendo-multiselect>
            </ng-template>
        </kendo-grid-column>

onRoleFilterChange(selectedRoles: any[]): void {
    this.state.filter = {
      logic: 'and',
      filters: selectedRoles.map(role => ({
          field: 'Roles',
          operator: 'eq',
          value: role
      }))
  };
    this.getAllData();
  }

The request is reaching the back-end.

[HttpPost]
public async Task<IActionResult> GetAllUser([DataSourceRequest] DataSourceRequest filter)
{
    var result = await this.userService.GetAllUser(filter);
    return CreateActionResultInstance(result);
}


public async Task<DataSourceResult> GetAllUser(DataSourceRequest filter)
{

    var result = await entity
          .AsNoTracking()
          .IgnoreQueryFilters()
          .Include(y => y.Roles)
          .Select(x => new UserViewModel
          {
              Idx = x.Idx,
              Email = x.Email,
              Name = x.Name,
              Phone = x.Phone,
              Surname = x.Surname,
              UserName = x.UserName,
              Roles = x.Roles.Select(x => x.Idx)
          }).ToDataSourceResultAsync(filter);
    return result;}

What I need here is for the filtering to work when a role is selected as a filter in the user list on the screen. How can we use a many-to-many table in this case? I researched a lot but couldn't find anything online.

As a note, the IDs of the roles are of type GUID.

Thanks :)



Ingenico
Top achievements
Rank 1
 asked on 20 Aug 2024
1 answer
67 views
I am using Kendo Multiselect with asp.net core where we have checkboxes . We allow the checkboxes to be multi-selected and unselected by clicking anywhere on label or checkbox. The issue is when a checkbox is selected, I want the focus to stay on the currently checked checkbox wrapped up in a <div> tag, but it's going to the last checked checkbox in the list.
Alexander
Telerik team
 answered on 29 Apr 2024
5 answers
3.0K+ views

I want to display a boolean value in an ASP.NET Core Kendo grid column. However, I need it to display a checkbox in the column because I don't want to show the users the raw data. So, I put in a custom client template because it's not an option to have booleans display a checkbox despite that seeming like an option that should be available by default. However, this grid is supposed to be editable inline using the default CRUD operations and you have to click on the cells to bring up the editor.

The default editor for a boolean column is a checkbox. So, the users click on a checkbox to bring up a different checkbox and it looks like it just didn't work. If I make the initial checkbox greyed out, it looks like they can't edit it. So, no matter what I do, I can't make a column a checkbox and use the default editor without a bunch of ugly design issues which is ridiculous.

Am I just missing something? Is there a better way than resorting to doing scripting with Javascript and setting the column to uneditable?

Maksim
Top achievements
Rank 1
Iron
 updated answer on 10 Nov 2023
1 answer
98 views
4032:46 Uncaught TypeError: jQuery(...).kendoCheckBox is not a function
    at HTMLDocument.<anonymous> (4032:46:169)
    at i (jquery.min.js:2:27466)
    at Object.fireWith [as resolveWith] (jquery.min.js:2:28230)
    at Function.ready (jquery.min.js:2:30023)
    at HTMLDocument.K (jquery.min.js:2:30385)

This is my code:

@model DMDPace.DataAccess.DomainModels.Project;

<div style="margin: 20px">
    <h3>Project: @Model.ProjectName</h3>
    <br/>
    <div style="display: flex">
        <h3 style="margin-right: 15px">Manager: </h3>

        @(Html.Kendo().DropDownListFor(x => x.ProjectManagerId)
            .DataTextField("DisplayName")
            .DataValueField("Id")
            .Events(e =>
            {
                e.Select("managerChange");
            })
            .DataSource(source =>
            {
                source.Read(read =>
                {
                    read.Action("FilterEmployees", "Home");
                });
            })
            .HtmlAttributes(new { style = "width: 15%; min-width: 280px;" }))
    </div>
    <div style="display: flex; align-items: center;">
        <h3 style="margin-right: 15px">Is Active: </h3>
    
        @(Html.Kendo().CheckBoxFor(x => x.IsActive))
    </div>
</div>

DropDownListFor renders correctly, but checkBoxFor doesn't.

Project:

    public class Project : Entity
    {
        public string ProjectName { get; set; }
        public bool IsActive { get; set; }
        
        public int? ProjectManagerId { get; set; }
        public virtual User ProjectManager { get; set; }
    }

Mihaela
Telerik team
 answered on 09 Aug 2023
1 answer
495 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
974 views

I upgrade from 'telerik.ui.for.aspnet.core.2019.1.220.commercial' to 'telerik.ui.for.aspnet.core.2023.1.117.commercial' and now the check box doesn't display check even though the data from the database is true

@(Html.Kendo().CheckBox() .Name("MyCheckbox").Label("Yes")

I even tried @(Html.Kendo().CheckBox() .Name("MyCheckbox").Checked(true).Label("Yes"), it still won't show the checkbox as checked.

Regards

 

Alexander
Telerik team
 answered on 21 Apr 2023
1 answer
1.3K+ views

I have a checkbox that is checked on a form but it should send its value on the post but should not be editable

The editor template looks like this

@(Html.Kendo().CheckBoxFor(m => m)
         .Label(label)
         .Enable(enable)
         .HtmlAttributes(ViewData)
         .Deferred(deferred)
   )

The checkbox does not have a readonly functionality like the textbox

Can this be achieved? I tried adding a hidden field like @Html.HiddenFor(m => m) but that generates another input with the same id

Mihaela
Telerik team
 answered on 15 Nov 2022
2 answers
134 views

When using the Boolean editor template with the grid HtmlHelper a label is created in the cell next to the checkbox. This was not always the case. Older versions of kendo excluded the label and only rendered the checkbox. Is there a way to turn off the label and only render the checkbox?

 vs 


Daniel
Top achievements
Rank 1
Iron
 answered on 28 Jun 2022
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?