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

We are currently trying to upgrade from 2019.3.917 to 2023.1.117

Some code that worked fine in the old version is failing in the new with error in kendo.combobox.js line 1221

Error message
Uncaught TypeError: Cannot read properties of undefined (reading 'renderButton')

Line 1221

values: kendo.cssProperties.roundedValues.concat([['full', 'full']])

the debugger is highlighting the second 'full'.

Our code is quite complex but commenting most of it out I get the same thing so a simplified version:

Our html page has this input

<input id="departments" style="width: 500px;" />

Then our javascript to create the combobox is

var $combo = $("#departments);

objKendoCB = $combo.kendoComboBox();

The second line results in the error. (the actual code sets lots of properties but I removed them one by one to end up with an empty method call).

Any ideas welcome!

 

Simon
Top achievements
Rank 1
 asked on 06 Mar 2023
1 answer
151 views

I am upgrading a .NET application from .NET 4.5 to .NET 6.0. As part of the upgrade have upgraded the Kendo.MVC dll as well from Version 2018.3.911.545 to 2022.1.119.0

 

In existing application we use Telerik grid and we use their template methods to define custom templates for Grid, toolbar and footer as shown below

pCol.Template( pT => { } ).Title( "" )
                                                  .Width( "3%" )
                                                  .ClientTemplate(
                                                      " #if (ExcludeFromWorkbook == false && ExcludeBtnExcludeFromWorkbookOnRow == false) {#" +
                                                      "<a class='btn btn-success btn-xs' id='btnIncludeExcludeInd_\"#=Id#\"' title='Row Included in Workbook, Click to Exclude from Workbook' onclick='onIncludeExcludeClick(this)'> <i class='fa fa-plus-square'></i> </a> #}"
                                                      + "if (ExcludeFromWorkbook == true && ExcludeBtnExcludeFromWorkbookOnRow == false) {# " +
                                                      "<a class='btn btn-danger btn-xs' id='btnIncludeExcludeInd_\"#=Id#\"' title='Row Excluded from Workbook, Click to Include in Workbook' onclick='onIncludeExcludeClick(this)'> <i class='fa fa-minus-square'></i> </a> #}"
                                                      + "else{# #}#"
                                                  )
                                                  .HtmlAttributes( new {style = "text-align: center;"} )
                                                  .ClientFooterTemplate( "#=conditionalSum('ExcludeFromWbBtn')#" );

 

  .ToolBar(toolbar =>
                            {
                                if (userCanEdit) //if user has edit rights show save and rest of toolbar template
                                {
                                    toolbar.Template(@<text>
                                                <div class="toolbar" id="toobarid1">
                                                    <input type="type" onblur="checkCommentField(this);" onkeypress="checkCommentField(this);" name="name" value="" class="k-textbox" id="componentComment" maxlength="500" placeholder="Edit values and add comment to enable Save..." style="width: 480px" />
                                                    @item.SaveButton()
                                                </div>
                                    </text>);
                                }
                            }) //e

 

But in the upgraded dll am unable to find the below method definitions

  • public virtual GridTemplateColumnBuilder<TModel> Template(Action<TModel> templateAction) in GridColumnFactory
  • public void Template(Func<Grid<T>, object> template); in GridToolBarCommandFactory
  • public GridBuilder<T> TableHtmlAttributes(object attributes); in GridBuilder  

Kindly let me know whats the equivalent methods available in the new dll to substitute the old ones and the new way of implementing our existing logic.

 

Eyup
Telerik team
 answered on 03 Mar 2023
0 answers
163 views
0

I use Kendo Spreadsheet widget with local data binding in MVC. How can I set the datasource to the spreadsheet to do create, update and delete operation?

I know this example,

https://demos.telerik.com/aspnet-mvc/spreadsheet/datasource

but ajax remote binding is not fine for me, because the excel file has a realy complex header with many merged cells. And remote data fills the first row which overwrite header files. So I use this example:

https://www.telerik.com/forums/loading-data-into-a-specific-row-in-kendo-spreadsheet

After using it data liested in the proper rows, but it's very slow.

So please give me some information to resolve this issue. A have to save modifications of the spreadsheet.

Here I list a simple example of how I bind the data:

ViewModel:

public int ID { get; set; }
    public int Name { get; set; }
    public string Status { get; set; }
}

Action in controller:

public ActionResult Index()
{
    List<ViewModel> model = service.GetData();
    return View(model);
}

View cshtml:

@model List<Namespace.Model.ViewModel>

@section body {

    @(Html.Kendo().Spreadsheet()
        .Columns(3)
        .Name("DataExcel")
        .HtmlAttributes(new { style = "width:auto; height: 770px;" })
        .Toolbar(false)
        .Sheetsbar(false)
        .Events(e => e
            .Select("Scripts.onSelect"))
        .Sheets(sheets =>
        {
            sheets.Add()
            .Name("DataSheet")
            .Columns(columns =>
            {
                // Megbízott neve és státusza + Tantárgy neve
                columns.Add().Width(50);
                columns.Add().Width(100);
                columns.Add().Width(100);
            }).Rows(rows =>
            {
                foreach (var dataRow in Model)
                {
                    rows.Add().Height(50).Cells(cells =>
                    {
                        // Megbízott státusza
                        cells.Add()
                            .Value(dataRow.ID)
                            .VerticalAlign(SpreadsheetVerticalAlign.Center)
                            .Color("black");

                        // Tantárgy neve
                        cells.Add()
                            .Value(dataRow.Name)
                            .VerticalAlign(SpreadsheetVerticalAlign.Center)
                            .Color("black");

                        // Órakeret
                        cells.Add()
                            .Value(dataRow.Status)
                            .VerticalAlign(SpreadsheetVerticalAlign.Center)
                            .Color("black")
                            .Bold(true);
                    }
                }
            });
        })
    )
}
Norbert
Top achievements
Rank 1
 asked on 02 Mar 2023
1 answer
133 views

I have a grid with popup editing. The grid is using a custom editor. The grid has the mobile attribute set.

When adding a record on a mobile(ipad) the editor is showing the hidden fields that accompany the kendo components. See Screen prints

 

 

Anton Mironov
Telerik team
 answered on 02 Mar 2023
1 answer
392 views

I need and older version of UI  for ASP.NET MVC, more exactly 2021.3.1207 which does not have so many changes on widgets and is compatible with jQuery 3.6.0.

I need trial version just to see if I can upgrade from 2017 version and jQuery from 1.10.2 without much effort and rewriting code.

Thanks

Eyup
Telerik team
 answered on 28 Feb 2023
2 answers
160 views

Hello,

I need help for the following issue:

this is the dropdown list -

                @Html.Kendo().DropDownListFor(m => m.PoLine[nr].ActivityId).DataTextField("Value").DataValueField("Key").DataSource(source =>
           {
               source.Read(read =>
               {
                   read.Action(@MVC.Budget.Budget.ActionNames.GetActivity, MVC.Budget.Name)
                       .Type(HttpVerbs.Post)
                       .Data("function () { return filterSubCategory('" + categoryId.Replace("\\", "\\\\") + "','" + subCategoryId.Replace("\\", "\\\\") + "'," + @current.ActivityId + "," + @nr + "); }");
               })
               .ServerFiltering(true);
           }).Enable(true).AutoBind(false).CascadeFrom(subCategoryId).Events(ev => { ev.Change("function(e){ var item = this.dataItem(); return true; return onchangeDivFromItemText(item,'" + string.Format(idReplace, "activity") + "')}"); }).HtmlAttributes(new { @class = "combo_date", style = "width:170px;" })

and this is the field where I want to be updated - 

@Html.UbiLabelValues(Model.RefMarketList.Where(item => item.Key.HasValue && item.Key.Value == Model.PoLine[nr].MarketId).FirstOrDefault().Value, LabelFor: "MarketName", className: "MarketName")

where UbiLabelValues returns - 

            string s = "<label for='{1}' {1} >{0}</label>";
            s = string.Format(s, text, LabelFor, className);
            return new MvcHtmlString(s);

I want to know how to change ev.Change of dropdown in order to referentiate the field with the new value selcted from dropdown.

Sorin
Top achievements
Rank 1
Iron
 answered on 27 Feb 2023
1 answer
138 views

Hello,

I need to implement hierarchical data grid where the relationship between parent-child records is two fields. Can you provide an example of how to establish the relationship in the grid using multiple key fields, please?

Thank you.

Patrick

Anton Mironov
Telerik team
 answered on 22 Feb 2023
1 answer
107 views

Hi there!


I would like to customize the header of GanttChart timeline, like 

if it is WeekView,  "2023/2" in 1st line and "1" , "8" (← it will be the first day of week) in 2nd line  or

if it is MonthlyView, "2023/Q1" in 1st line and "2", "3" (← it will be the month number like "2" means Feburay) in 2nd line.

let me know how should I customize to that.

I think that I should use "Views.MonthView.MonthHeaderTemplate" function, but I have no idea how I used it.

I found this API from this following link, but I can't get detail info because it had died.

ASP.NET MVC Gantt - API Reference - Telerik UI for ASP.NET MVC

Could you please share me if there is any link in which explaination for gantt API info, how to use or which parameter should be passed.

Eyup
Telerik team
 answered on 20 Feb 2023
1 answer
247 views
 
In MVC application I am using Kendo column charts and I have the data as below.
TypePercentageDateColor
A25.52/12#2456C7
B702/13#2456C8
B502/14#2456C8
B55.52/15#2456C8
A60.32/13#2456C8

I want to create a column chart with this data, chart should be categorized by Date and there should be multiple columns depending on the type.

I wrote the below code snippet but it isn't working, cannot see the data on UI.

 @(Html.Kendo().Chart<EntitiesA.Report>
                ()
                .Name("Report")
                .Title("ReportA")
                .Legend(legend => legend
                .Position(ChartLegendPosition.Top)
                )
                .DataSource(dataSource => dataSource
                    .Read(read => read.Action("MethodReport", "ReportController"))
                    .Group(group => group.Add(model => model.Type))
                    .Sort(sort => sort.Add(model => model.Date).Ascending())
                )
                .Series(series =>
                {
                    series.Column(model => model.Percentage)
                        .Name("#= group.value # (Percentage)").CategoryField("Date").ColorField("Color");
                })
                .Legend(legend => legend
                    .Position(ChartLegendPosition.Bottom)
                )
                .CategoryAxis(axis => axis
                    .Labels(labels => labels.Format("MM/DD"))
                )
                .ValueAxis(axis => axis.Numeric()
                                .Labels(labels => labels.Format("{0:N0}"))
                                .MajorUnit(20)
                                .Max(100)
                                .Line(line => line.Visible(false))
                )
                .Tooltip(tooltip => tooltip
                .Visible(true)
                .Format("{0:N0}")
                )
                ) 

I don't see any data in the graph it is blank how to fix it, am I missing any logic or piece of code.

Eyup
Telerik team
 answered on 20 Feb 2023
2 answers
132 views

Hi,

How to pass antiForgeryToken in MVC Kendo form

Karina
Telerik team
 answered on 16 Feb 2023
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
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
DateTimePicker
TimePicker
StockChart
RadialGauge
ContextMenu
ArcGauge
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?