Telerik Forums
UI for ASP.NET MVC Forum
1 answer
32 views
      Error CS0234: The type or namespace name 'FileBrowserController' does not exist in the namespace 'Kendo.Mvc.UI' (are you missing an assembly reference?) (15, 55)
      Error CS0246: The type or namespace name 'EditorImageBrowserController' could not be found (are you missing a using directive or an assembly reference?) (16, 43)
Mihaela
Telerik team
 answered on 07 May 2025
1 answer
19 views

I am trying to implement a custom tool in the Kendo Editor, following demo/doc implementation and always getting a typeError of some form whenever the custom tool uses a kendo template.  For example:

@(Html.Kendo().Editor()
    .Name("editor")
    .Tools(tools => {
            tools
        .Clear()
        .Bold()
        .Italic()
        .CustomTemplate(temp => temp.Template(
                Html.Kendo().DropDownList()
                    .Name("ddl1")
                    .DataTextField("Text")
                    .DataValueField("Value")
                    .BindTo(new List<object>
                    {
                        new { Text = "text 1", Value = "Value 1" },
                        new { Text = "text 2", Value = "Value 2" },
                        new { Text = "text 3", Value = "Value 3" },
                        new { Text = "text 4", Value = "Value 4" }
                    })
                    .ToClientTemplate()
                    .ToHtmlString()
                ));
    })
)

In this case the error is as follows:

Uncaught TypeError: Cannot read properties of null (reading 'length')

Mihaela
Telerik team
 answered on 05 May 2025
1 answer
26 views

We are using KendoEditor in our MVC application. When assigend HTML to it it is auto formatting it. E.g.
<p style="font-size:13.3333px;"><span style="font-family:Verdana, Geneva, sans-serif;font-size:14pt;">Dear ABC</></></></span></p><p style="font-size:13.3333px;"><span style="font-family:Verdana, Geneva, sans-serif;font-size:14pt;">We have received your details:&nbsp;</span><span style="color:#ffffff;"><span id="spa123"><span> Certificates</span><table class="tbl" border="1" cellpadding="1" cellspacing="0" style="width:100%;font-family:inherit;font-size:inherit;color:inherit;" ><tr style="font-weight:bold;"><td style="text-align: right">Id</td><td style="text-align: left">name</td><td style="text-align: left">Amount</td><td style="text-align: left">Other</td><td style="text-align: left">Comments</td></tr><tr><td style="text-align: right;">1</td><td style="text-align: left;"></td><td style="text-align: left;"></td><td style="text-align: left;"></td><td style="text-align: left;"></td></tr></table></span></span> <span style="background-color:#ffffff;color:#ffffff;"></span></p>

changing to 

<p style="font-size:13.3333px;"><span style="font-family:Verdana, Geneva, sans-serif;font-size:14pt;">Dear ABC</span></p>
<p style="font-size:13.3333px;"><span style="font-family:Verdana, Geneva, sans-serif;font-size:14pt;">We have received your details:&nbsp;</span><span style="color:#ffffff;"><span id="spa123"><span>Certificates</span></span></span></p>
<table class="tbl k-table" border="1" cellpadding="1" cellspacing="0" style="width:100%;font-family:inherit;font-size:inherit;color:inherit;"><tbody><tr style="font-weight:bold;"><td style="text-align:right;">Id</td>
<td style="text-align:left;">name</td>
<td style="text-align:left;">Amount</td>
<td style="text-align:left;">Other</td>
<td style="text-align:left;">Comments</td>
</tr>
<tr><td style="text-align:right;">1</td>
<td style="text-align:left;">&nbsp;</td>
<td style="text-align:left;">&nbsp;</td>
<td style="text-align:left;">&nbsp;</td>
<td style="text-align:left;">&nbsp;</td>
</tr>
</tbody></table>
<span style="background-color:#ffffff;color:#ffffff;"></span><p>&nbsp;</p>

Here <span> and <P> tags automatically getting closed before table. while extected is all should be in span with <span style="color:#ffffff;">.

 

Not able to trace why it is happning.

Anton Mironov
Telerik team
 answered on 29 Apr 2025
1 answer
32 views

 i.Add()
 .Id(Id.ToString())
 .Name(Id.ToString())
 .Title(Name.ToString())
 .Field(Id.ToString())
 .Label(l => l.Text(Lab + ":"))
 .Editor(e =>
 {
     e.NumericTextBox<Decimal>()
         .Format("c")
         .Value(System.Convert.ToDecimal(Answer));
 });

Posted above is an item on a form unfortunately the Value property doesn't display anything nor does hard coding a number into Value property. However, when I place the same variable into the placeholder property, it does seem to display what its supposed to. Is there a reported bug for why this is happening or perhaps a work around to assist this. 

Thank you in advance for your assistance

Eyup
Telerik team
 answered on 05 Apr 2025
1 answer
101 views
Given the deprecation of the EditorImageBrowserController in Q1 2024 release of Kendo UI, we're seeking guidance on the best approach to migrate our existing application. Could you please provide specific recommendations on how to achieve image management (read, upload and etc) in image browser (from Editor) using the latest Kendo UI components and best practices?
Eyup
Telerik team
 answered on 10 Dec 2024
1 answer
36 views

  @(Html.Kendo().Grid<RVNLMIS.Models.ListMasterBOQResourceCalc>()
   .Name("ResourceTypeGrid")
   .Columns(columns =>
   {

       // Resource Type column
       columns.Bound(c => c.RsrcType)
           .Title("Resource Type")
           .ClientTemplate("#= RsrcType ? RsrcType.ResourceTypeName : '' #")
           .EditorTemplateName("ClientResource")
           .Sortable(false)
           .HtmlAttributes(new { style = "text-align:left" })
           .HeaderHtmlAttributes(new { style = "text-align:left" })
           .Width(120)
           ;

       // Resource Name column
       columns.Bound(c => c.drpResource)
           .Title("Resource")
           .ClientTemplate("#= drpResource ? drpResource.ResourceName : ''#")
           .EditorTemplateName("ClientSubResources")
           .Sortable(false)
           .HtmlAttributes(new { style = "text-align:left" })
           .HeaderHtmlAttributes(new { style = "text-align:left" })
           .Width(120);

       // Quantity column
       columns.Bound(c => c.rsrcQty)
           .Title("Quantity")
           .HtmlAttributes(new { style = "text-align:right" })
           .HeaderHtmlAttributes(new { style = "text-align:right" })
           .Width(70)
           .Format("{0:N2}");

       // Wastage Percentage column
       columns.Bound(c => c.wastagePct)
           .Title("Wastage %")
           .HtmlAttributes(new { style = "text-align:right" })
           .HeaderHtmlAttributes(new { style = "text-align:right" })
           .Width(60);

       // Total Quantity column
       columns.Bound(c => c.TotalQty)
           .Title("Total Qty")
           .HtmlAttributes(new { style = "text-align:right" })
           .HeaderHtmlAttributes(new { style = "text-align:right" })
           .Width(80)
           .Format("{0:N2}");

       // Unit column
       columns.Bound(c => c.Unit)
           .Title("Unit")
           .HtmlAttributes(new { style = "text-align:left" })
           .HeaderHtmlAttributes(new { style = "text-align:left" })
           .Width(60);

       // Base Rate column
       columns.Bound(c => c.BaseRate)
           .Title("Base Rate")
           .HtmlAttributes(new { style = "text-align:right" })
           .HeaderHtmlAttributes(new { style = "text-align:right" })
           .Width(80)
           .Format("{0:N2}");

       // Total Rate column
       columns.Bound(c => c.TotalRate)
           .Title("Resource Amount")
           .HtmlAttributes(new { style = "text-align:right" })
           .HeaderHtmlAttributes(new { style = "text-align:right" })
           .Width(100)
           .Format("{0:N2}");
       columns.Command(command => command.Destroy()).Width(150);
   })
   .ToolBar(t =>
   {
       t.Create().HtmlAttributes(new { style = "float:right; margin: 5px;" });
       t.Save().HtmlAttributes(new { style = "float:right; margin: 5px;" });
   })
   .Editable(editable => editable.Mode(GridEditMode.InCell))
   .Pageable() // Pagination enabled
   .Sortable() // Sorting enabled
   .Scrollable() // Scrollable grid
   .HtmlAttributes(new { style = "height:500px;" })
   .DataSource(dataSource => dataSource
       .Ajax()
       .Batch(true) // Batch editing
       .ServerOperation(false) // Client-side operations
       .Model(model =>
       {
           model.Id(p => p.AutoID); // Set primary key
           model.Field(p => p.AutoID).Editable(false); // Disable editing for AutoID
           model.Field(p => p.RsrcType).DefaultValue(
                       ViewData["defaultResourceType"] as RVNLMIS.Controllers.Sub_BOQController.ResourceTypeModel);
           model.Field(p => p.drpResource).DefaultValue(new RVNLMIS.Controllers.Sub_BOQController.DrpResourceModel
           {
               ResourceName = "Select Resource",
               ResourceID = 0
           });
       })
       .PageSize(20) // Set page size
       .Read(read => read.Action("GetBOQResource_Details", "Sub_BOQ").Data("getBOQId"))
       .Create(create => create.Action("EditingCustom_Create", "Sub_BOQ"))
       .Update(update => update.Action("EditingCustom_Update", "Sub_BOQ"))
       .Destroy(destroy => destroy.Action("EditingCustom_Destroy", "Sub_BOQ"))
   )
)

Above is grid code , the tool bar is not showing at the top of the grid .

It should show like below example.

 

Eyup
Telerik team
 answered on 22 Nov 2024
1 answer
82 views

I have a grid popup edit template that includes a Kendo dropdown.  I need to pass a model property value as the parameter to the Read() method of the dropdown.  But the model is null when the Read() method gets called.   So the value is always 0.  

I've defined the Field in the parent grid.  I even added it as a column too.  Model.ProductId is always 0.

How do I pass a value from the popup editor model to the controller for the dropdown?

                    @(Html.Kendo().DropDownList()
                        .Name("WarehouseId")
                        .OptionLabel("Select a warehouse...")
                        .HtmlAttributes(new { style = "width: 100%" })
                        .DataTextField("Text")
                        .DataValueField("Value")
                        .Value("-1")
                        .DataSource(source =>
                        {
                            source.Read(read =>
                            {
                                read.Action("Inventory_Warehouse_Read", "Purchasing", new { productId = @Model.ProductId});
                            });
                        })
                        .Height(400)
                        )

Mihaela
Telerik team
 answered on 29 Oct 2024
1 answer
79 views
I am using a kendo popup window as a form to edit items on a grid. If there are errors with defining the properties if should return to the window with error messages. This is Controller action. Currently if the modelstate is not valid it returns a view without and styling (just Html)> If I return View instead of Partial the page loads correctly but as a full page and not a window
public ActionResult EditActivity(EditActivity model)
		{
			var activity = _uow.Activities.GetById(model.ActivityId);

			activity.Phone = model.Phone;
			activity.Fax = model.Fax;
			activity.LastUpdateDate = DateTime.Now;
			activity.LastUpdatedBy = _sessionHandler.UserId;
			if (ModelState.IsValid)
			{
				try
				{
                    _uow.Activities.Update(activity);
                    _uow.Commit();
                    TempData["SaveResultMessage"] = $"Changes to Activity : {activity.ActivityName} have been saved";
                }
				catch
				{
                    ModelState.AddModelError("Save", "Error occurred on save.");
                }

				return RedirectToAction("Index", "DepartmentActivity", new
				{
					id = activity.DepartmentId,
				});
			}

			return View(model);

Alexander
Telerik team
 answered on 07 Jun 2024
1 answer
68 views

In rich text editor does kendo support the layout column selection same as we have option in word like this

does kendo mvc rich text editor support that if yes please let us know how ?

Mihaela
Telerik team
 answered on 01 May 2024
1 answer
298 views

I have review this form discussions but cannot get this working.

How to add a delete button to editor template Grid Popup? in Kendo UI for jQuery | Telerik Forums

 

How can I add an additional update button inside of my grid popup editor template? I have the exact same requirements as discussed in 

Add extra button to Grid popup editor template in UI for ASP.NET MVC | Telerik Forums

Perhaps little different as I am using a custom popup editor template called RecordEdit.cshtml as outlined in  ASP.NET MVC Data Grid Component Use Custom Popup Editors - Telerik UI for ASP.NET MVC
@(Html.Kendo().Grid//....
  //....
 .Events(ev=>ev.Edit("onEdit"))  
 .Editable
  (
      editable => editable.Mode(GridEditMode.PopUp)
      .TemplateName("RecordEdit")
      .Window(e => e.Width(1400).Height(1200))
  )
)
 
function onEdit() {
    $('<a class="k-button k-button-icontext k-grid-delete" href="\\#"><span class="k-icon k-delete"></span>Delete</a>').insertAfter(".k-grid-cancel");
}
Any assistance would be most helpful.
Ivan Danchev
Telerik team
 answered on 26 Apr 2024
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?