Telerik Forums
UI for ASP.NET MVC Forum
0 answers
7 views
In the grid control I want to do GridFilterMode.Row filtering but to increase performance I want to remove the auto complete and default filtering.  How can I disable that option and just make it a manual filter only?
Dave Wolf
Top achievements
Rank 1
 asked on 14 Jan 2022
1 answer
4 views

Hello, 

I have implemented the ASP.NET MVC Gantt into my project. I am having a slight issue when adding to the grid.

 

After adding, the entry for the Task shows a skinny bar with no text, when in fact database shows it does have text for the entry. Hovering over it shows the correct text. Picture below:

 

 

Refreshing the grid does not update it, although it appears totally correct in the database. Thanks for any help. Side question - how can I change the theme of my grid? I saw there are many theme options.

Ivan Danchev
Telerik team
 answered on 14 Jan 2022
1 answer
7 views
I'm a beginner who started learning ASP.NET Core just now and wanted to know what the difference was. How much does it differ? Do I need to know ASP.NET MVC fully before learning ASP.NET Core MVC?
Yanislav
Telerik team
 answered on 14 Jan 2022
0 answers
3 views

We've added the Telerik.UI.for.AspNet.Mvc4.2021.3.1207 NuGet package to our project and I was wondering what the best practices are for excluding unneeded content from publishing. There is a folder called 2021.3.1207-source which by default is published with all the other content that the NuGet package has added. So far we have manually marked the content to not be included when published in our build pipelines, but we're wondering if there is a more standard way of doing this? Is there a NuGet package which excludes the source folder?

In addition to this, is there a preferred method of excluding themes from a project? Again we can manually remove them or mark them to not be published, but I was wondering if there is a suggested way to configure what is and isn't included.

Many thanks

Bill
Top achievements
Rank 1
 asked on 14 Jan 2022
1 answer
6 views

Hi..

I am experiencing that when i create an event via the popup on scheduler, and save, a debug breakpoint placed in the Create method of the controller, can be observed to fire between 2 and 4 times. i checked the database and it indeed runs the whole save process 2 or 4 times with the same data.

My view has the following code:

<div id="citizenAppointmentCalender" class="calenderContainer">
	@(Html.Kendo().Scheduler<AppointmentTaskViewModel>()
		.Name("appointmentsCalender")
		.Height(820)
		.Editable(e => {
			e.TemplateName("CitizenAppointmentsEditorPartialView");
			e.EditRecurringMode(SchedulerEditRecurringMode.Series);
		})
		.DateHeaderTemplate("<strong>#=kendo.toString(date, 'ddd dd-MMM')#</strong>")
		.AllDaySlot(false)
		.Timezone("Europe/Copenhagen")
		.EventTemplate("<div class='eventBox' style='background-color:#= BackColor #; color:#= FontColor #;'><div class='eventInner'><span>#= title #</span></div><div class='eventInner'><span>#= description #</span></div></div>")
		.Views(views => {
			views.DayView();
			views.WeekView(x => x.Selected(true));
			views.MonthView();
		})
		.Events(x => {
			x.Edit("caed_Dialog_Edit");
			x.Save("caed_Dialog_Save");
		})
		.DataSource(d => {
			d.Model(m => { m.Id(f => f.ID); });
			d.Read(read => read.Action("Read", "CitizenDashboard").Type(HttpVerbs.Post));
			d.Create("Create", "CitizenDashboard");
			d.Destroy("Destroy", "CitizenDashboard");
			d.Update("Update", "CitizenDashboard");
		})
	)
</div>

 

The controller code:

public virtual JsonResult Create([DataSourceRequest] DataSourceRequest request, AppointmentTaskViewModel task) {
    if (ModelState.IsValid) {
	appointmentService.Insert(task, ModelState);
    }

    return Json(new[] { task }.ToDataSourceResult(request, ModelState));
}

 

Finally the javascript for the "edit" and "save" events:

function caed_Dialog_Edit(e) {
	$("#caed_eventType_private")[0].checked = false;
	$("#caed_eventType_medical")[0].checked = false;
	$("#caed_eventTypes_PrivateBox")[0].classList.add("hide");
	if (e.event.Type == 3) {
		$("#caed_eventType_private")[0].checked = true;
		$("#caed_eventTypes_PrivateBox")[0].classList.remove("hide");
	} else if (e.event.Type == 2) {
		$("#caed_eventType_medical")[0].checked = true;
	}
	var buttons = e.container[0].children[0].children[1];
	if (e.event.IsNexusAppointment) {
		$("#caed_Title")[0].setAttribute("disabled", "disabled");
		$("#caed_Description")[0].setAttribute("disabled", "disabled");
		$("#caed_startDate").data("kendoDateTimePicker").enable(false);
		$("#caed_endDate").data("kendoDateTimePicker").enable(false);
		$("#caed_eventType_medical")[0].setAttribute("disabled", "disabled");
		$("#caed_eventType_private")[0].setAttribute("disabled", "disabled");
		$("#caed_isPersonal")[0].setAttribute("disabled", "disabled");
		$("#caed_recurrence").data("kendoRecurrenceEditor").element[0].disabled = true;

		buttons.children[0].classList.add("hide"); // Save btn
		buttons.children[1].innerText = "OK";
		if (buttons.children.length >= 3)
			buttons.children[2].classList.add("hide"); // Delete btn

	} else {
		$("#caed_Title")[0].removeAttribute("disabled");
		$("#caed_Description")[0].removeAttribute("disabled");
		$("#caed_startDate").data("kendoDateTimePicker").enable(true);
		$("#caed_endDate").data("kendoDateTimePicker").enable(true);
		$("#caed_eventType_medical")[0].removeAttribute("disabled");
		$("#caed_eventType_private")[0].removeAttribute("disabled");
		$("#caed_isPersonal")[0].removeAttribute("disabled");
		$("#caed_recurrence").data("kendoRecurrenceEditor").element[0].disabled = false;

		buttons.children[0].classList.remove("hide"); // Save btn
		buttons.children[1].innerText = "Fortryd";
		if (buttons.children.length >= 3)
			buttons.children[2].classList.remove("hide"); // Delete btn
	}
}
function caed_Dialog_Save(e) {
	if (e.event.caed_eventType_radio)
		e.event.Type = parseInt(e.event.caed_eventType_radio);

	if (e.event.Type == 3) {
		e.event.IsPersonal = e.event.caed_isPersonal ? e.event.caed_isPersonal : false;
		e.event.BackColor = "#ffa500";
		e.event.FontColor = "#fff";

	} else if (e.event.Type == 2) {
		e.event.BackColor = "#F02222";
		e.event.FontColor = "#fff";
	}

	var scheduler = $("#appointmentsCalender").data("kendoScheduler");
	scheduler.dataSource.sync();
}

 

With these 3 snippets of code.. you can duplicate the issue. No need for a sample project. The "Insert" method simply puts the data from the model into an entity framework object and saveChanges is called, nothing more. But by then its already reproducible. 

So just make a new event and press save. Remember to put a breakpoint at the start of the create method.

 

HOW can i prevent this from happening?

Yanislav
Telerik team
 answered on 14 Jan 2022
1 answer
5 views

We're using a virtualized MultiColumnComboBox including the filter functionality 'contains'.

Unfortunately a filter on an integer field throws an error 'FormatException' on ToDataSourceResult

Is there a default way of making this work, or do we have to modify the DataSourceRequest manually?

If the latter, is there an example of how to do it?

Ivan Danchev
Telerik team
 answered on 12 Jan 2022
1 answer
5 views

We're using the MultiColumnComboBoxFor with a large amount of data, and therefore implemented virtualization as is described here: https://demos.telerik.com/aspnet-mvc/multicolumncombobox/virtualization

We ran into multiple problems with this:

  1. The line data: convertValues(options.value) did not work for us; the server method never received any values.
    We had to use data: { values: options.value }.
  2. Empty values were not displayed correctly in the dropdown:

    We changed the following style to display these correctly:
    .k-grid-list.k-virtual-list > .k-item > .k-cell, .k-grid-list.k-virtual-list > .k-item > .k-group, .k-grid-list.k-virtual-list > .k-item > .k-spacer-group {   
    display: table-cell;
    }

Are there any drawbacks to our solution?

Ivan Danchev
Telerik team
 answered on 12 Jan 2022
0 answers
10 views

a model is returned to the form in which parameter "Raion" bool has a value of true or false.
How to make it so that CheckBox itself takes the required value?

@(Html.Kendo().CheckBox().Name("Raion").Label("Выезд на район"))

public class ServiceViewModel
    {
*****
        public bool Raion { set; get; }
****
    }
@model service.Models.ServiceViewModel

@(Html.Kendo().CheckBox().Name("Raion").Label("Выезд на район"))




Вадим
Top achievements
Rank 1
Iron
Iron
 asked on 11 Jan 2022
1 answer
6 views

Good afternoon,

I've successfully managed to use PdfProcessing in a similar way to the demo but I want to include some error capture.  What's the best way to return the error to the View and display it e.g. if the file doesn't exist?

[HttpPost]
public ActionResult Download_Document()
{
    try
    {
        PdfFormatProvider formatProvider = new PdfFormatProvider();
        formatProvider.ExportSettings.ImageQuality = ImageQuality.High;

        byte[] renderedBytes = null;
        using (MemoryStream ms = new MemoryStream())
        {
            RadFixedDocument document = CreatePdfDocument.CreateDocument();
            formatProvider.Export(document, ms);
            renderedBytes = ms.ToArray();
        }

        return File(renderedBytes, "application/pdf", "PdfDocument.pdf");
     }
     catch (Exception e)
     {
         return e.Message;
     }
}

Kind regards,

Richard

Richard
Top achievements
Rank 2
Iron
Iron
Iron
 answered on 10 Jan 2022
1 answer
9 views

HI,  

I am working on the MVC.net (not core) application.  used the few stuff from Kendo ui, like autocomplete and notification.  Everything works fine on local and when deployed to the Azure without the automated CI/CD process.

 

Now when it came to the do the build for CI/CD I am getting the below error:

ResolveAssemblyReferences: Primary reference "Kendo.Mvc". ##[warning]C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2203,5): Warning MSB3245: Could not resolve this reference. Could not locate the assembly "Kendo.Mvc". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Kendo.Mvc". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [D:\a\1\s\MyApp\MyApp.csproj] For SearchPath "{HintPathFromItem}".

 

//Properties in Visual Studio for the dll

Although the code is running fine after deployment and on local but I noticed that the Telerick or Keno dlls that are sever in reference folder

are missing from the Package folder.

Anton Mironov
Telerik team
 answered on 10 Jan 2022
Narrow your results
Selected tags
Tags
+? more
Top users last month
Richard
Top achievements
Rank 2
Iron
Iron
Iron
Bernd
Top achievements
Rank 3
Iron
Iron
Iron
Matthias
Top achievements
Rank 5
Bronze
Bronze
Iron
Benedikt
Top achievements
Rank 3
Iron
Iron
Iron
CHIHPEI
Top achievements
Rank 1
Iron
Iron
Iron
Top users last month
Richard
Top achievements
Rank 2
Iron
Iron
Iron
Bernd
Top achievements
Rank 3
Iron
Iron
Iron
Matthias
Top achievements
Rank 5
Bronze
Bronze
Iron
Benedikt
Top achievements
Rank 3
Iron
Iron
Iron
CHIHPEI
Top achievements
Rank 1
Iron
Iron
Iron