Telerik Forums
UI for ASP.NET MVC Forum
0 answers
211 views
I have a grid inside my grid editor template (subgrid). And both grids have popup editing. Right now the subgrids popup window shows as a part of the main grid editor template (right below the subgrid) and it doesn't show the title. How can I show it as a new window?
Valeria
Top achievements
Rank 1
 asked on 17 Jan 2022
1 answer
104 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
460 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
131 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
0 answers
136 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
85 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 4
Bronze
Bronze
Iron
 answered on 10 Jan 2022
1 answer
709 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
2 answers
4.4K+ views

I am trying to use Kendo Grid in a razor view.
I have reference for the required css and js files in bundle.config:

bundles.Add(new StyleBundle("~/Content/kendo/css").Include(
               "~/Content/kendo/kendo.common.min.css",
               "~/Content/kendo/kendo.common-bootstrap.min.css",
               "~/Content/kendo/kendo.bootstrap.min.css"
               ));
            bundles.Add(new ScriptBundle("~/Scripts/kendo/js").Include(
                    "~/Scripts/kendo/jquery.min.js",
                    "~/Scripts/kendo/kendo.all.min.js",
                    "~/Scripts/kendo/kendo.aspnetmvc.min.js"
                ));

In the View I have this:

@using Kendo.Mvc.UI;
@using Kendo.Mvc.Extensions;

@model WebApplication.Models.TMS_Categories

@{
    ViewBag.Title = "Index";
}



<h2>Index</h2>

<div class="container">
    <div class="row">

        @(Html.Kendo().Grid<WebApplication.Models.TMS_Categories>()
                                    .Name("CategoriesGrid")
                                    .Selectable()
                                            .Columns(columns =>
                                            {
                                                columns.Bound(c => c.ID).Width(50);
                                                columns.Bound(c => c.PrimaryCategoryName).Title("P Name").Width(100);
                                                columns.Bound(c => c.SecondaryCategoryName).Title("S Name").Width(100);
                                                columns.Bound(c => c.PrimaryDescription).Title("Primary Desc").Width(100);
                                                columns.Bound(c => c.SecondaryDescription).Title("Secnd Desc").Width(100);
                                                columns.Bound(c => c.Code).Width(100);
                                                columns.Bound(c => c.OrganizationID).Title("OrgID").Width(100);
                                                columns.Bound(c => c.CreatedBy).Width(100);
                                                columns.Bound(c => c.CreatedDate).Width(100);
                                                columns.Bound(c => c.UpdatedBy).Width(100);
                                                columns.Bound(c => c.UpdatedDate).Width(100);
                                                columns.Bound(c => c.IsDeleted).Width(100);
                                                columns.Bound(c => c.IsActive).Width(100);
                                                columns.Bound(c => c.IsDefault).Width(100);
                                                columns.Bound(c => c.CompanyID).Width(100);
                                                columns.Bound(c => c.CategoryType).Width(100);
                                                columns.Command(command =>
                                                {
                                                    command.Edit();
                                                    command.Destroy();
                                                }).Width(200);

                                            })
                                    .DataSource(dataSource => dataSource
                                        .Ajax()
                                        .Model(model =>
                                        {
                                            model.Id(cat => cat.ID);
                                            model.Field(cat => cat.ID).Editable(false);
                                        }
                                        )
                                        .Read(read => read.Action("GetAllCategories", "Categories"))
                                      .Update(update => update.Action("UpdateCategory", "Categories"))
                                      .Create(create => create.Action("Addcategory", "Categories"))
                                      .Destroy(destroy => destroy.Action("DeleteCategory", "Categories"))

                                        )
                                   .ToolBar(toolbar => toolbar.Create())
                                   .Editable(editable => editable.Mode(GridEditMode.InLine))
                                    .Sortable()
                                    .Selectable()
                                    .Pageable(pageable =>
                                    {
                                        pageable.Refresh(true);
                                        pageable.PageSizes(true);
                                    })
        )
    </div>
</div>

When I run the code on chrome I get an error in console and data is not bound with grid only column names are shown but not any data row is showing :

 

Uncaught TypeError: jQuery(...).kendoGrid is not a function
    at HTMLDocument.<anonymous> (Index:54)
    at i (jquery.min.js:2)
    at Object.fireWith [as resolveWith] (jquery.min.js:2)
    at Function.ready (jquery.min.js:2)
    at HTMLDocument.K (jquery.min.js:2)

and also when i click Add New Record button I get the data in this form:

 

{"Data":[{"ID":1,"PrimaryCategoryName":"a","SecondaryCategoryName":"b","PrimaryDescription":"dsa","SecondaryDescription":"fewf","Code":"123","OrganizationID":1,"CreatedBy":1,"CreatedDate":"\/Date(1562439600000)\/","UpdatedBy":1,"UpdatedDate":"\/Date(1562439600000)\/","IsDeleted":false,"IsActive":true,"IsDefault":false,"CompanyID":2,"CategoryType":3},{"ID":2,"PrimaryCategoryName":"f","SecondaryCategoryName":"g","PrimaryDescription":"ddsf","SecondaryDescription":"gfh","Code":"434","OrganizationID":3,"CreatedBy":3,"CreatedDate":"\/Date(1562439600000)\/","UpdatedBy":3,"UpdatedDate":"\/Date(1562439600000)\/","IsDeleted":true,"IsActive":false,"IsDefault":false,"CompanyID":1,"CategoryType":2}],"Total":2,"AggregateResults":null,"Errors":null}

 

Any body here to help me?

Salama
Top achievements
Rank 1
Iron
Iron
 answered on 07 Jan 2022
0 answers
129 views

https://www.telerik.com/forums/implement-dropdown-tree-co

 

I need to add default values for dropdown tree

After clicking of create button on above sample provided code

 

froger
Top achievements
Rank 1
Iron
 asked on 07 Jan 2022
1 answer
258 views

A security scan caught security vulnerabilities on several javascript files included with ASP.NET MVC version 2021.3.1109:

[1] kendo 2021.3.1109 kendo.dataviz.map.min.js

"The application's tileTitle:this._tileTitle}},wrapIndex:function embeds untrusted data in the generated output with location, at line 26"

[2] kendo 2021.3.1109 kendo.data.min.js

"The application's e},destroyed:function embeds untrusted data in the generated output with wrapAll, at line 26"

[3] kendo 2021.3.1109 kendo.aspnetmvc.min.js

"The application's !function embeds untrusted data in the generated output with href, at line 25"

[4] kendo 2021.3.1109 kendo.mobile.min.js

"The application's r.rightElement=n embeds untrusted data in the generated output with inArray, at line 35"

Can I safely exclude these files from my project?

Thanks.

Georgi
Telerik team
 updated answer on 06 Jan 2022
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
Upload
ComboBox
MultiSelect
ListView
Window
TabStrip
Menu
Installer and VS Extensions
Spreadsheet
AutoComplete
TreeList
Gantt
PanelBar
NumericTextBox
Filter
ToolTip
Map
Diagram
Button
PivotGrid
Form
ListBox
Splitter
Application
FileManager
Sortable
Calendar
View
MaskedTextBox
PDFViewer
TextBox
Toolbar
MultiColumnComboBox
Dialog
DropDownTree
Checkbox
Slider
Switch
Notification
ListView (Mobile)
Pager
Accessibility
ColorPicker
DateRangePicker
Wizard
Security
Styling
Chat
MediaPlayer
TileLayout
DateInput
Drawer
SplitView
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Template
Badge
LinearGauge
ModalView
ResponsivePanel
TextArea
Breadcrumb
ExpansionPanel
Rating
ScrollView
ButtonGroup
CheckBoxGroup
NavBar
ProgressBar
QRCode
RadioButton
Scroller
Timeline
TreeMap
TaskBoard
OrgChart
Captcha
ActionSheet
Signature
DateTimePicker
AppBar
BottomNavigation
Card
FloatingActionButton
Licensing
Localization
MultiViewCalendar
PopOver (Mobile)
Ripple
ScrollView (Mobile)
Switch (Mobile)
PivotGridV2
FlatColorPicker
ColorPalette
DropDownButton
AIPrompt
PropertyGrid
ActionSheet (Mobile)
BulletGraph
Button (Mobile)
Collapsible
Loader
CircularGauge
SkeletonContainer
Popover
HeatMap
Avatar
ColorGradient
CircularProgressBar
SplitButton
StackLayout
TimeDurationPicker
Chip
ChipList
DockManager
ToggleButton
Sankey
OTPInput
ChartWizard
SpeechToTextButton
InlineAIPrompt
TimePicker
StockChart
RadialGauge
ContextMenu
ArcGauge
AICodingAssistant
+? 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?