Telerik Forums
UI for ASP.NET MVC Forum
1 answer
925 views
I was expecting to get either null or a date object out of the parser, always.  However i discovered when we tried to parse the number 253 that you'll end up with this error:  Uncaught TypeError: e.indexOf is not a function at ... (where ... is the kendo file and location).

It seems to work ok if you .toString() everything.
Georgi
Telerik team
 answered on 12 Jan 2021
1 answer
253 views

I have a grid in my web application(ASP.NET MVC). When I was testing it with NVDA Screen reader, NVDA reads its header and data(Content) section separately, like they are two different tables. May be this issue is due to two different table tags are used for header and grid content, that's why NVDA is reading it separately. How to solve this issue to make sure that NVDA recognize grid header and content as a single table only.

Alex Hajigeorgieva
Telerik team
 answered on 12 Jan 2021
1 answer
676 views

I added Kendo.Mvc.dll (2018.3.1017.545) to my mvc project in vs2019.

I write this code in my index.cshtml file.
@(Html.Kendo().Editor() .Name("Test") .HtmlAttributes(new { style = "width: 100%; height:840px" }) .Tools(tools => tools .Clear() .Bold().Italic().Underline() .JustifyLeft().JustifyCenter().JustifyRight() .InsertUnorderedList().InsertOrderedList() .Outdent().Indent() .CreateLink().Unlink() .InsertImage() .TableEditing() .FontName() .FontSize() .BackColor() .FontColor() ) .ImageBrowser(imageBrowser => imageBrowser .Image("~/shared/UserFiles/Images/{0}") .Read("Read", "ImageBrowser") .Create("Create", "ImageBrowser") .Destroy("Destroy", "ImageBrowser") .Upload("Upload", "ImageBrowser") ) .Value(@<text> </text>) )

and I added this using at top of my file:

@using Kendo.Mvc.UI

and I added these Scripts to _layout:

<script src="~/Scripts/kendo/kendo.all.min.js"></script>

<script src="~/Scripts/kendo/kendo.aspnetmvc.min.js">

</script><script src="~/Scripts/kendo/kendo.editor.min.js"></script>

even once I added all .js and .css file of kendo, but not worked.

but in chrome I see an empty TextArea.

what else should I do to fix it?

thanks

Dimo
Telerik team
 answered on 12 Jan 2021
1 answer
201 views

Hi,

I have a grid with a subgrid. A column in the parentgrid is calculated based on the sum of columns in the subgrid. When editing a column the value is saved properly. I have to do a refresh/read of the grids to show the new value. This is working properly. But after the refresh it is not visible for the user which row he just edited because everything is collapsed. How can I expand the row after the save to show the subgrid?

Kind regards,

Roel Alblas

Alex Hajigeorgieva
Telerik team
 answered on 12 Jan 2021
1 answer
719 views

Hi,

I like to render a column in the MVC grid with a dynamically rendered field with a color hex. This is in a subgrid wich is generated like below:

.ClientDetailTemplateId("templateSubTasks")

I know that when using a hashtag in a template grid you have to proceed it with two \ I also know that when using a hashtag for example a color hex, you have to proceed it with 4 \. But what when the color hex is loaded with a value from the data property like  #= data.TaskLabel?data.TaskLabel.Color:'' #

Her you can see the column I create in the parent grid. This has to be adjusted for use in a subgrid as a template.

columns.Bound(c => c.TaskLabel).Title(Order.clmLabel).ClientTemplate("<div style='border-radius: 3px; display:inline; width: 8px; height: 18px; background-color: #= data.TaskLabel?data.TaskLabel.Color:'' #'>&nbsp; </div><span style='margin-left:10px'> #= data.TaskLabel?data.TaskLabel.Name:'' #</span>").Width(100).Encoded(false).EditorTemplateName("GridDropdownEditorLabel");

I didn't succeed with adding \\\\ to the property data.TaskLabel.Color.

Do you have any idea?

Kind regards,

Roel Alblas

Martin
Telerik team
 answered on 12 Jan 2021
1 answer
591 views

Hello,

Does anyone have an idea how to keep check box check status when changed page? 

I added check box as a ( ClientTemplate) column, user can check or uncheck them. but check box's value was removed after page moving. How to keep those status?  Thanks in advance.

Georgi Denchev
Telerik team
 answered on 11 Jan 2021
1 answer
465 views

Hello,

 

in C# I've got 2 ViewModels:

```

public class TestListViewModel

{

    public string Param { get; set; }

    public IEnumerable<TestViewModel> Counts { get; set; }

}

```

 

```

public class TestViewModel

{

    public string Name { get; set; }

    public int Count { get; set; }

}

```

 

now I will pass IEnumerable<TestListViewModel> as model to grid. How can I get the result like this: https://demos.telerik.com/aspnet-mvc/grid/aggregates?

I don't need to aggregate any data because it's already done. I just need to fill this grid somehow.

It's my local data, so the Grid will starts with:

```

@(Html.Kendo().Grid(Model)

    .Name("grid")

    .Columns(columns => (?))

    (...)

)

```

Anton Mironov
Telerik team
 answered on 11 Jan 2021
2 answers
143 views

Another 'Invalid Template' error ... there are tons out there, and I thought I'd find my answer, but no.

The hierarchy (nested) grid below works great until I uncomment line 58 or 67.  Then I get the invalid template error.

I've escaped my hash symbols on line 52 as I read in a ton of other posts.

Does anyone spot anything amiss???

TIA

001.@(Html.Kendo().Grid<OrgViewModel>()
002.    .Name("Grid")
003.    .Columns(columns =>
004.    {
005.        columns.Bound(e => e.OrgType).Hidden(true);
006.        columns.Bound(e => e.OrgId).Hidden(true);
007.        columns.Bound(e => e.OrganizationType).Title("Partner or Charter");
008.        columns.Bound(e => e.OrgName).Title("Name");
009.    })
010.    .Filterable(filterable => filterable
011.        .Extra(false)
012.        .Operators(operators => operators
013.            .ForString(str => str.Clear()
014.                .StartsWith("Starts with")
015.                .IsEqualTo("Is equal to")
016.                .IsNotEqualTo("Is not equal to")
017.            ))
018.    )
019.    .Groupable()
020.    .Pageable(m => m.PageSizes(new[] { "20", "50", "100", "All" }))
021.    .Resizable(resizable => resizable.Columns(true))
022.    .Sortable()
023.    .Scrollable(s => s.Enabled(true))
024.    .ClientDetailTemplateId("template")
025.    .HtmlAttributes(new { style = "height:850px;" })
026.    .DataSource(dataSource => dataSource
027.        .Ajax()
028.        .PageSize(20)
029.        .Read(read => read.Action("Orgs_Read", "FiscalContacts"))
030.        .Sort(sort =>
031.        {
032.            sort.Add(x => x.OrgName);
033.            sort.Add(x => x.OrgType);
034.        })
035.    )
036.    .Events(events => events.DataBound("dataBound"))
037.    )
038. 
039.@section scripts {
040.<script id="template" type="text/kendo-tmpl">
041.    @(Html.Kendo().Grid<FiscalContactViewModel>()
042.        .Name("Grid_#=OrgType#_#=OrgId#") // template expression, to be evaluated in the master context
043.        .Columns(columns =>
044.        {
045.            //columns.Command(command => { command.Edit(); }).Width(250);
046.            columns.Bound(o => o.Id).Hidden(true);
047.            columns.Bound(o => o.SalesforceId).Hidden(true);
048.            columns.Bound(o => o.LastName);
049.            columns.Bound(o => o.FirstName);
050.            columns.Bound(o => o.Title);
051.            columns.Bound(o => o.Email);
052.            columns.Bound(x => x.ExecComm).Title("Exec").Width(75).Filterable(true).ClientTemplate("\\#=ExecComm ? 'Yes': ''\\#").HtmlAttributes(new { style = "text-align:center" });
053.            columns.Bound(o => o.Roles);
054.            columns.Bound(o => o.FiscalPermissions).Title("Perms").Width(75);
055.        })
056.        .ToolBar(tools =>
057.        {
058.            //tools.Create();
059.            tools.Excel();
060.        })
061.        .Excel(excel => excel
062.            .FileName("Fiscal Contacts.xlsx")
063.            .Filterable(true)
064.            .AllPages(true)
065.            .ProxyURL(Url.Action("Excel_Export_Save", "FiscalContacts"))
066.        )
067.       
001.@(Html.Kendo().Grid<OrgViewModel>()
002.    .Name("Grid")
003.    .Columns(columns =>
004.    {
005.        columns.Bound(e => e.OrgType).Hidden(true);
006.        columns.Bound(e => e.OrgId).Hidden(true);
007.        columns.Bound(e => e.OrganizationType).Title("Partner or Charter");
008.        columns.Bound(e => e.OrgName).Title("Name");
009.    })
010.    .Filterable(filterable => filterable
011.        .Extra(false)
012.        .Operators(operators => operators
013.            .ForString(str => str.Clear()
014.                .StartsWith("Starts with")
015.                .IsEqualTo("Is equal to")
016.                .IsNotEqualTo("Is not equal to")
017.            ))
018.    )
019.    .Groupable()
020.    .Pageable(m => m.PageSizes(new[] { "20", "50", "100", "All" }))
021.    .Resizable(resizable => resizable.Columns(true))
022.    .Sortable()
023.    .Scrollable(s => s.Enabled(true))
024.    .ClientDetailTemplateId("template")
025.    .HtmlAttributes(new { style = "height:850px;" })
026.    .DataSource(dataSource => dataSource
027.        .Ajax()
028.        .PageSize(20)
029.        .Read(read => read.Action("Orgs_Read", "FiscalContacts"))
030.        .Sort(sort =>
031.        {
032.            sort.Add(x => x.OrgName);
033.            sort.Add(x => x.OrgType);
034.        })
035.    )
036.    .Events(events => events.DataBound("dataBound"))
037.    )
038. 
039.@section scripts {
040.<script id="template" type="text/kendo-tmpl">
041.    @(Html.Kendo().Grid<FiscalContactViewModel>()
042.        .Name("Grid_#=OrgType#_#=OrgId#") // template expression, to be evaluated in the master context
043.        .Columns(columns =>
044.        {
045.            //columns.Command(command => { command.Edit(); }).Width(250);
046.            columns.Bound(o => o.Id).Hidden(true);
047.            columns.Bound(o => o.SalesforceId).Hidden(true);
048.            columns.Bound(o => o.LastName);
049.            columns.Bound(o => o.FirstName);
050.            columns.Bound(o => o.Title);
051.            columns.Bound(o => o.Email);
052.            columns.Bound(x => x.ExecComm).Title("Exec").Width(75).Filterable(true).ClientTemplate("\\#=ExecComm ? 'Yes': ''\\#").HtmlAttributes(new { style = "text-align:center" });
053.            columns.Bound(o => o.Roles);
054.            columns.Bound(o => o.FiscalPermissions).Title("Perms").Width(75);
055.        })
056.        .ToolBar(tools =>
057.        {
058.            //tools.Create();
059.            tools.Excel();
060.        })
061.        .Excel(excel => excel
062.            .FileName("Fiscal Contacts.xlsx")
063.            .Filterable(true)
064.            .AllPages(true)
065.            .ProxyURL(Url.Action("Excel_Export_Save", "FiscalContacts"))
066.        )
067.        //.Editable(editable => editable.Mode(GridEditMode.InCell))
068.        .DataSource(dataSource => dataSource
069.            .Ajax()
070.            .PageSize(10)
071.            .Read(x => x.Action("ListContacts", "FiscalContacts", new { orgType = "#=OrgType#", orgId = "#=OrgId#" }))
072.            .Create(x => x.Action("FiscalContacts_Create", "FiscalContacts", new { orgType = "#=OrgType#", orgId = "#=OrgId#" }))
073.            .Update(x => x.Action("FiscalContacts_Update", "FiscalContacts"))
074.            .Model(model =>
075.            {
076.                model.Id(x => x.Id);
077.                model.Field(x => x.Id).Editable(false);
078.                model.Field(x => x.FiscalPermissions).Editable(false);
079.            }).Sort(sort =>
080.            {
081.                sort.Add(x => x.LastName);
082.                sort.Add(x => x.FirstName);
083.            })
084.        )
085.        .Filterable(filterable => filterable
086.            .Extra(false)
087.            .Operators(operators => operators
088.                .ForString(str => str.Clear()
089.                    .StartsWith("Starts with")
090.                    .IsEqualTo("Is equal to")
091.                    .IsNotEqualTo("Is not equal to")
092.                ))
093.        )
094.        .Groupable()
095.        .HtmlAttributes(new { style = "height:600px;" })
096.        .Pageable(m => m.PageSizes(new[] { "20", "50", "100", "All" }))
097.        .Resizable(resizable => resizable.Columns(true))
098.        .Sortable()
099.        .Scrollable(s => s.Enabled(true))
100.        .ToClientTemplate()
101.    )
102.</script>
103.    <script>
104.        function dataBound() {
105.            this.expandRow(this.tbody.find('tr.k-master-row').first());
106.        }
107.</script>
108.}
.Editable(editable => editable.Mode(GridEditMode.InCell))
068.        .DataSource(dataSource => dataSource
069.            .Ajax()
070.            .PageSize(10)
071.            .Read(x => x.Action("ListContacts", "FiscalContacts", new { orgType = "#=OrgType#", orgId = "#=OrgId#" }))
072.            .Create(x => x.Action("FiscalContacts_Create", "FiscalContacts", new { orgType = "#=OrgType#", orgId = "#=OrgId#" }))
073.            .Update(x => x.Action("FiscalContacts_Update", "FiscalContacts"))
074.            .Model(model =>
075.            {
076.                model.Id(x => x.Id);
077.                model.Field(x => x.Id).Editable(false);
078.                model.Field(x => x.FiscalPermissions).Editable(false);
079.            }).Sort(sort =>
080.            {
081.                sort.Add(x => x.LastName);
082.                sort.Add(x => x.FirstName);
083.            })
084.        )
085.        .Filterable(filterable => filterable
086.            .Extra(false)
087.            .Operators(operators => operators
088.                .ForString(str => str.Clear()
089.                    .StartsWith("Starts with")
090.                    .IsEqualTo("Is equal to")
091.                    .IsNotEqualTo("Is not equal to")
092.                ))
093.        )
094.        .Groupable()
095.        .HtmlAttributes(new { style = "height:600px;" })
096.        .Pageable(m => m.PageSizes(new[] { "20", "50", "100", "All" }))
097.        .Resizable(resizable => resizable.Columns(true))
098.        .Sortable()
099.        .Scrollable(s => s.Enabled(true))
100.        .ToClientTemplate()
101.    )
102.</script>
103.    <script>
104.        function dataBound() {
105.            this.expandRow(this.tbody.find('tr.k-master-row').first());
106.        }
107.</script>
108.}
Kim
Top achievements
Rank 1
Veteran
 answered on 11 Jan 2021
1 answer
82 views

I am experiencing an issue where, using Internet Explorer 11, the animation containers on certain components do not appear in alignment with the component they are originating from. For the most part, what this means is the animations appear off to the left, but sometimes, animations also open above where they would open below on Edge or Chrome. Affected components are dropdown list in a grid's popup editor and filter menus appearing after a filter icon on a grid column is pressed.

Identical issue: https://stackoverflow.com/questions/60257190/alignment-issue-with-kendo-ui-dropdown-list-in-ie11

It seems like resolution has some influence on this because in some cases, the issue goes away when the page is very zoomed out (though it isn't very comfortable for the user at this point).

Neli
Telerik team
 answered on 07 Jan 2021
6 answers
197 views

Hello

I am trying to  implement kendo grid,

I see all the data in grid but when i move to next page all the data is deseapers.

This is my controller code

  public async Task<ActionResult> TodaysSalesList([DataSourceRequest] DataSourceRequest request, DateTime? fileDate, int? pageSize, int? pageNo, int? loanCustomerId)
        {
            PagedResults<VmpLoanSalesVM> resultloans;
            try
            {
                var startDate = fileDate.GetValueOrDefault().Date;

                var dic = new DualControlDictionary
                {
                    { "date", startDate.Date.ToString() },
                    { "loanCustomerId", loanCustomerId.ToString() }
                };
                resultloans = await _dualControlService.GetData(dic);   
                var jsonRes = Json(resultloans.Results.ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
                jsonRes.MaxJsonLength = int.MaxValue;
                return jsonRes;
            }
            catch (Exception e)
            {
                Log.Error(e);
                return Json(new
                {
                    success = false
                }, JsonRequestBehavior.AllowGet);
            }
        }

I have also tried return the data like this 

 var jsonRes = Json( new {Data=resultloans.Results.ToDataSourceResult(request),Total=esultloans.ResultsCount()}, JsonRequestBehavior.AllowGet);
                jsonRes.MaxJsonLength = int.MaxValue;
                return jsonRes;

But it doesn't help

See attched file my grid cshtml

Preslav
Telerik team
 answered on 06 Jan 2021
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
Licensing
NavBar
ProgressBar
QRCode
RadioButton
Scroller
Timeline
TreeMap
TaskBoard
OrgChart
Captcha
ActionSheet
Signature
DateTimePicker
AppBar
BottomNavigation
Card
FloatingActionButton
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?