Telerik Forums
UI for ASP.NET MVC Forum
0 answers
19 views

Is there any way to set the column name for the expendable column of the parent for ClientDetailsTemplateId .

 

There are three issues with this, first, it does not show the column name, the second I want to change the width of these columns and third there is no column separator as we have for other columns.

 

Please find the attached screenshot.

Vivek
Top achievements
Rank 1
Iron
 asked on 31 Aug 2021
1 answer
16 views

Hi Team,

We are using RadEditor in our MVC application. Content entered or copied is converted to RTF format and then saved to database.

But when we copy text like following from Microsoft word:- Text  for “Unicode ‘Testing’ Test” (text containing quotes entered in MS word) ,       after exporting to RTF, it is converting to Unicode characters as following :-    \u8220?UniCode \u8216?Testing\u8217? Test\u8221.

 

Even when we disable the filter of ConvertCharactersToEntitiesas shown below, still it is not working.

RadEditor1.DisableFilter(Telerik.Web.UI.EditorFilters.ConvertCharactersToEntities));

Instead of replacing the above characters by hardcoding them, is there any possible way to avoid this Unicode conversion. Please let us know if it is possible.


Thanks in Advance,

Sushma Katneni

Rumen
Telerik team
 answered on 30 Aug 2021
1 answer
22 views
Hi, I am working on kendo grid while updating the record it should check the condition, if the condition is satisfied means then only we can update it, otherwise the update should not take place and alert must be rised
Eyup
Telerik team
 answered on 30 Aug 2021
1 answer
17 views

I have enabled conditional ClientDetailTemplateId in Kendo MVC Grid, It's working as expected.

 

But I also want to enable/disable the row on cell value change in the grid. So If ID is X then should not be expandable, but if it's other than X then it should be expandable (show the expandable mark on the first cell, and on click of it it should show the child div).

I have tried this, But it is not working.

 


<script id="templateSubRow" type="text/kendo-tmpl">
    # if (ID == 'X') { #

    <div>Child Div</div>

    # } #
</script>


@(Html.Kendo().Grid<MyModel>()
.Name("mygrid")

.Columns(columns =>
{
    columns.Bound(config => config.ID).Width(90).Title("ID").HeaderHtmlAttributes(new { @class = "grid-headercustom" })
        .HtmlAttributes(new { @class = "grid-rowcustom" }).Filterable(ftb => ftb.Enabled(true));
})
.HtmlAttributes(new { style = "height:100%" })
.NoRecords("No Data Available")
.Editable(e => e.Mode(GridEditMode.InCell))
.Scrollable()
.Sortable()
.Navigatable()
.Filterable()
.DataSource(dataSource => dataSource
.Ajax()
.ServerOperation(false)
.Events(e => e.Change("onChange"))
.Read(read => read.Action("MyActionMethod", "MyController"))
.PageSize(150)
.Model(model => { model.Id(p => p.ID);
    model.Field(p => p.ID).Editable(true);
}))
.ClientDetailTemplateId("templateSubRow")
.Events(x => x.DataBound("dataBound"))

)
function dataBound() {
    var dataSource = this.dataSource;
    this.element.find('tr.k-master-row').each(function () {
        var row = $(this);
        var data = dataSource.getByUid(row.data('uid'));
        if (data.ID === 'X') {
            row.find('.k-hierarchy-cell a').css({ opacity: 0.0, cursor: 'default' }).click(function (e) { e.stopImmediatePropagation(); return false; });
        }
    });
}

function onChange(e) {
    if (e.action == "itemchange") {
        var items = e.items;
        var grid = $('#mygrid').data('kendoGrid');
        for (var i = 0; i < items.length; i++) {
            var dataItem = items[i];
            if (e.field == 'ID') {
                var rowCells = grid.element.find("tr[data-uid=" + dataItem.uid + "] td");
                if (dataItem.ID === 'X') {
                    $(rowCells[0]).addClass('kendo-cell-highlighter');
                    $(rowCells[0]).click(function (e) { e.stopImmediatePropagation(); return false; });
                }
                else {
                    $(rowCells[0]).removeClass('kendo-cell-highlighter');
                    $(rowCells[0]).click(function (e) { return true; });
                }
            }
        }
    }
}



<style>
    .kendo-cell-highlighter {
        opacity: 0.0;
        cursor: default
    }
</style>

Milena
Telerik team
 answered on 27 Aug 2021
1 answer
17 views
Is there a way to set this property globally for an entire ASP.Net project/solution?
Anton Mironov
Telerik team
 answered on 26 Aug 2021
1 answer
20 views

I am upgrading my application to Telerik UI for AspNet.Core v2021.2.616.  I got the grid to display data, but the grid pager component shows 0 as the current page and the pager navigation controls are disabled

 

Here is the view

<text>

<kendo-grid name="usersGrid" on-data-bound="UserMaintenance.onDataBound" selectable="true">

	<datasource type="DataSourceTagHelperType.Ajax" page-size="5">
		<transport>
			<read url="@Url.Action("GetUsers""User"new { Area = "Admin" })" type="post" />
		</transport>
		<schema data="data">
		</schema>
	</datasource>
	<columns>
		<column field="userId" title="User Id" width="1" visible="false" html-attributes='new Dictionary<stringobject>{ ["class"] = "primary-key" }' />
		<column field="userName" title="User Name" />
		<column field="stateUserId" title="State User Identifier" />
		<column field="email" title="Email" />
		<column field="isActive" title="Active" template="#= isActive ? 'Yes' : 'No' #" width="100" />
		<column title="Actions">
			<commands>
				<column-command text="Edit" id="edit" name="edit" click="function(e){UserMaintenance.onOpenEditUserModal(e, 'UserId')}" />
				<column-command text="Deactivate" id="deactivate" name="deactivate" click="function(e){UserMaintenance.onOpenDeleteUserModal(e, 'UserId')}" />
				<column-command text="Activate" id="activate" name="activate" click="function(e){UserMaintenance.onOpenActivateUserModal(e, 'UserId')}" />
			</commands>
		</column>
	</columns>
 
	<toolbar>
		<toolbar-button text="Add User" name="Add" template="UserMaintenance.userCustomTemplate" />
	</toolbar>
 
	<scrollable enabled="true" />
	<groupable enabled="true" />
	<sortable enabled="true" />
	<pageable enabled="true" responsive="false" button-count="5" refresh="true" page-sizes="new int[] { 5, 10, 20 }"></pageable>
	<filterable enabled="true" />
</kendo-grid>

</text>

Here is the controller method

<text>

public ActionResult GetUsers([DataSourceRequest] DataSourceRequest request, string userSearch)
{
    var users = _uow.UserRepository.GetAll()
        .AsNoTracking()
        .OrderBy(u => u.UserName);
 
    var result = users.ToDataSourceResult(request);
 
    return Json(result);
}

</text>

 

What am I missing?  If this is not enough information, let me know what else you need to see

 

Thanks

 

Anton Mironov
Telerik team
 answered on 26 Aug 2021
1 answer
21 views

 

Hello,

We used both kendo Grid and kendo Chart in our MVC project. When we load big data on Grid , the Processing Wheel image (see below image)  had automatically applied to UI even we don’t setting anything. Unlike Grid I did not found same image applied to the UI when get big data for chart. Since we need calculate the value based on the busyness logic which take bit longer time. Now user will wait in front of empty chart screen until chart finally showed up.  Could Telerik team have some guides for resolving the issue?  Thanks.

 

Image of Processing data...

Petar
Telerik team
 answered on 25 Aug 2021
1 answer
36 views

Hi,

Im using kendo MVC version 2016.3.1118.545

I want to use equal to filter on date and time column for format {MM/dd/yyyy hh:mm tt} but its not working

I have seen few solution but its only for filtering date alone.

Please provide some solution for this

1 answer
24 views

Hello,

I'm currently working on adding content to a ClientGroupHeaderTemplate and I run into some issues regarding aggregate functions and what type of logical expressions I can use within the template itself.

 

https://docs.telerik.com/aspnet-mvc/html-helpers/data-management/grid/templates/group-templates

 

I cannot seem to use if{}else{} statements as I normally do in Telerik component templates. And I was wondering if I could utilize a version of the aggregate functions but on other columns in the same group instead of the actual column, the group by is being done on.

 

For Example:

 


trip.Add().Text("New").Selected(true).Content(@<text>
                                                       <div class="row">
                                                           @(Html.Kendo().DataSource<OrderSearchBindingModel>().Name("newDataSource").Ajax(t =>
                                                       {
                                                           t.Read(read => read.Action("GetOrderSearch", "Fulfillment", new { status = "New"}));
                                                           t.PageSize(300);
                                                           t.ServerOperation(true);
                                                           t.Group(p => p.Add("KitControl", typeof(string)));
                                                           t.Aggregates(agg =>
                                                           {
                                                               agg.Add(field => field.InternalOrderId).Count();
                                                           });
                                                           t.Events(events => events.Error("error_ajax"));
                                                       }))
                                                           <div class="col-2">
                                                               @(Html.Kendo().Filter<OrderSearchBindingModel>()
                                                                   .Name("newFilter")
                                                                   .ApplyButton()
                                                                   .ExpressionPreview()
                                                                   .MainLogic(FilterCompositionLogicalOperator.Or).Fields(f =>
                                                               {
                                                                   f.Add(p => p.InternalOrderId).Label("Internal Order ID");
                                                                   f.Add(p => p.ExternalOrderId).Label("External Order ID");
                                                                   f.Add(p => p.KitControl).Label("Kit Control");
                                                                   f.Add(p => p.Department).Label("Department");
                                                                   f.Add(p => p.WorkCenter).Label("Work Center");
                                                               }).FilterExpression(fe =>
                                                               {
                                                                   fe.Add(p => p.InternalOrderId);
                                                               }).DataSource("newDataSource"))
                                                           </div>
                                                           <div class="col-9">
                                                               @(Html.Kendo().Grid<OrderSearchBindingModel>().Name("newOrderGrid").Columns(columns =>
                                                           {
                                                               columns.Bound(p => p.InternalOrderId).Width(95).ClientGroupHeaderColumnTemplate("Total Orders: #= sum #");
                                                               columns.Bound(oi => oi.ExternalOrderId).Width(110);
                                                               columns.Bound(p => p.CreatedDate).Format("{0:MM/dd/yyyy HH:mm tt}").Width(120);
                                                               columns.Bound(oi => oi.DueDate).Width(120);
                                                               columns.Bound(oi => oi.KitControl)
                                                                   .ClientGroupHeaderTemplate("#= value != null ? value : 'Non-Kitted' || value != '   ' ? value : 'Non-Kitted' || value != undefined ? value : 'Non-Kitted' # <button type='button' class='manifest-btn btn btn-sm btn-info d-inline'>Manifest</button>").Width(190);
                                                               columns.Bound(oi => oi.Department).Width(95);
                                                               columns.Bound(oi => oi.WorkCenter).Width(95);
                                                               columns.Command(command =>
                                                               {
                                                                   command.Custom("View").Click("order_view").HtmlAttributes(new{@class="btn btn-sm btn-info d-block text-white"});
                                                                   command.Custom("Packing Slip").Click("order_packing_slip").HtmlAttributes(new { @class = "btn btn-sm btn-info d-block text-white" });
                                                                   command.Custom("Pick Ticket").Click("order_pick_ticket").HtmlAttributes(new { @class = "btn btn-sm btn-info d-block text-white" });
                                                                   command.Custom("Reprint").Click("order_reprint").HtmlAttributes(new { @class = "btn btn-sm btn-info d-block text-white" });
                                                               }).Width(125);
                                                           }).ClientDetailTemplateId("order-detail")
                                                                   .HtmlAttributes(new {style = "height: 750px"})
                                                                   .Scrollable()
                                                                   .Groupable()
                                                                   .Filterable()
                                                                   .Resizable(r => r.Columns(true))
                                                                   .Sortable()
                                                                   .Pageable()
                                                                   .Events(events => events.DataBound("on_bound"))
                                                                   .DataSource("newDataSource"))
                                                           </div>
                                                       </div>

I cannot even get the evaluation correct with the current group header template to replace empty text with a "No Kit Control" placeholder it just shows up empty still. As well as the Aggregate of the internal order id not showing up in the header as well, that is something I made an attempt at but I couldn't seem to get a reference to work properly in the ClientGroupHeaderTemplate.

I had attempted to apply some if{}else{} conditional logic to not display the KitControl Manifest button however that would just give me script/tag errors on page render.

Is there a more comprehensive description of the template capabilities I am missing? Or am I just trying to push this template too far?

 

Eyup
Telerik team
 answered on 24 Aug 2021
1 answer
24 views

I have two password fields on a form. I have used your demo way to change there editor to password boxes. If I validate in the controller and pass back an error message indicating they need to match the error message is not displayed. How do I correct this. I am open to preventing the submit with a little javascript validation so it never goes to the server. Please Advise.


                        i.Add()
                            .Field(f => f.Password)
                            .EditorTemplateHandler("setPasswordEditor")
                            .Label(l => l.Text("Password:"));

                        i.Add()
                            .Field(f => f.ConfirmPassword)
                            .EditorTemplateHandler("setConfirmPasswordEditor")
                            .Label(l => l.Text("Confirm Password:"));


        function setPasswordEditor(container, options) {
            container.append($("<input type='password' class='k-textbox k-valid' id='Password' name='Password' title='Password' required='required' autocomplete='off' aria-labelledby='Password-form-label' data-bind='value:Password' aria-describedby='Password-form-hint'>"));
        }
        function setConfirmPasswordEditor(container, options) {
            container.append($("<input type='password' class='k-textbox k-valid' id='ConfirmPassword' name='ConfirmPassword' title='Confirm Password' required='required' autocomplete='off' aria-labelledby='Password-form-label' data-bind='value:ConfirmPassword' aria-describedby='Password-form-hint'>"));
        }


            if (model.Password!=model.ConfirmPassword)
            {
                ModelState.AddModelError("Password", "Passwords Must Match");
                ModelState.AddModelError("ConfirmPassword", "Passwords Must Match");
                return View("UserEditView",model);
            }

Eyup
Telerik team
 answered on 24 Aug 2021
Top users last month
Matthias
Top achievements
Rank 5
Bronze
Bronze
Iron
Psyduck
Top achievements
Rank 4
Bronze
Bronze
Iron
Liu
Top achievements
Rank 1
Iron
Alex
Top achievements
Rank 1
Veteran
Iron
Iron
George C.
Top achievements
Rank 2
Iron
Veteran