Telerik Forums
UI for ASP.NET MVC Forum
1 answer
130 views

I have 2 comboBox(s) on a grid.  When the user clicks the edit button, I want the values that are in the comboBox to stay, currently they blank out.  Why is it doing this, and what's the simple solution.

 

 

Alex Hajigeorgieva
Telerik team
 answered on 22 Aug 2019
4 answers
1.1K+ views
If I create and then immediately update, it will not have ID and treat the update as new insert and will show error message of "javascript runtime error: unable to get property 'ID' of undefined or null reference."

If I create and then immediately delete, same error message and it will not delete the data as it has no new inserted id.

But I can update or delete if the grid is refreshed by refreshing the web page.  What did I miss?

​ <%: Html.Kendo().Grid<zProvince>()
.Name("GridProvince")
.Columns(columns =>
{
columns.Bound(o => o.ProvinceName).Title("Name");
columns.Bound(o => o.empgroupName).Title("empgroupName");
columns.Bound(o => o.ID).Hidden();
columns.Command(command => { command.Edit(); command.Destroy(); }).Width(180);
})
.ToolBar(commands => commands.Create())
.Editable(editable => editable.Mode(Kendo.Mvc.UI.GridEditMode.InLine))
.DataSource(dataSource => dataSource
.Ajax()
.Model(model => model.Id(p => p.ID))
.Read(read => read.Action("GetProvince", "Admin"))
.Create(create => create.Action("CreateProvince", "Admin"))
.Update(update => update.Action("UpdateProvince", "Admin"))
.Destroy(destroy => destroy.Action("DestroyProvince", "Admin"))
)
.Events(events => events
.Change("change"))
.Selectable(s => s.Mode(Kendo.Mvc.UI.GridSelectionMode.Single))
.Scrollable()
.Pageable()
%>
Alex Hajigeorgieva
Telerik team
 answered on 22 Aug 2019
4 answers
167 views

I'm having a VERY odd problem.

I have an application with a number of date/time pickers. When running the application locally, all date times are displayed correctly, and stored correctly in the database.

When the application is published to Azure, there's an issue. For example, if a user adds a record with a date of 8/1/2019, then saves / refreshes. The record is displayed with a date of 7/31/2019 (date minus 1). In this scenario, the correct date is still being stored in the database.

It's seems likely that something is amiss with Azure (since there are no issues when running locally) but I'm not sure where I should be looking. I checked the obvious stuff (time zones, etc) but couldn't find anything that accounts for this odd behavior.

Has anyone experienced this issue before? Any feedback would be much appreciated.

Georgi
Telerik team
 answered on 22 Aug 2019
3 answers
111 views
When a blank Kendo Editor loses focus, the only way to regain focus is to click in the upper left corner right about where the cursor would be located by default. This issue doesn't seem to occur in Firefox.

It can be recreated on the demo page (at least in the version of Chrome I'm currently using, Version 75.0.3770.100): https://demos.telerik.com/aspnet-mvc/editor

1. Highlight the existing text and clear all of it.

2. Click outside the Editor.

3. Click inside the Editor anywhere other than the upper left corner. The editor does not regain focus.

Is there a potential workaround for this issue?
Kevin
Top achievements
Rank 1
 answered on 21 Aug 2019
3 answers
2.6K+ views

Is any way to access kendo controls in EditorTemplate?

If I have

@Html.Kendo().DropDownList().Name("Name1").HtmlAttributes(new { style = "width:100%;" })

int EditorTemplate

In Edit event of grid or inside EditorTemplate attempt to access kendo controls returns undefined value like

$("#Name1").data("kendoDropDownList") is undefined.

 

It undefined in edit event, it undefined anywhere I believe due to control is not being initialized yet.

Viktor Tachev
Telerik team
 answered on 21 Aug 2019
1 answer
114 views

Looking for info on editor templates. Link is broken.

    https://docs.telerik.com/aspnet-mvc/helpers/grid/templating/editor-templates

 

 

 

Nikolay
Telerik team
 answered on 20 Aug 2019
2 answers
453 views

Hello,

I'm trying to use autocomplete in a Batch Editing Grid.  After selecting a value from the autocomplete list when I leave the field the old value stay in the text zone.  See attachment to understand better.

This is my view.

@(Html.Kendo().Grid<SafetyStudioWeb.Areas.Maintenance.ViewModels.Equipe.EquipemModell>()
            .Name("Equipement")
            .Columns(columns =>
            {
                columns.Bound(p => p.DateIntervention).Format("{0:yyyy-MM-dd}").Width(70).HtmlAttributes(new { style = "text-align:center" });
                columns.Bound(p => p.NombreHeuresUtilisationIntervention).Width(50).HtmlAttributes(new { style = "text-align:center" });
                columns.Bound(p => p.ResponsableEntretienIntervention).Width(80).EditorTemplateName("AutoCompleteResponsableEntretienIntervention");
                columns.Command(command => { command.Destroy(); }).HtmlAttributes(new { style = "text-align:center" }).Width(95);
            })
            .ToolBar(toolBar =>
            {
                toolBar.Create();
                toolBar.Save();
            })
            .Editable(editable => editable.Mode(GridEditMode.InCell))
            .HtmlAttributes(new { style = "font-size:11px;height: 300px;" })
            .Scrollable()
            .Selectable(s => s.Enabled(false))
            .Pageable(pageable => pageable
            .Refresh(true)
            .ButtonCount(5))
 
            .DataSource(dataSource => dataSource
                .Ajax()
                .Batch(true)
                .ServerOperation(false)
                .PageSize(100)
                .Model(model =>
                {
                    model.Field(field => field.DateIntervention).DefaultValue(System.DateTime.Now);
                })
                .Sort(a => a.Add("DateIntervention").Descending()).Sort(a => a.Add("NombreHeuresUtilisationIntervention").Descending())
                .Read(read => read.Action("SommaireEquipementIntervention", "Equipements", new { Id = Model.EquipementId }))
                .Create(create => create.Action("CreateEquipementIntervention", "Equipements", new { Id = Model.EquipementId }))
                .Update(update => update.Action("UpdateEquipementIntervention", "Equipements"))
                .Destroy(destroy => destroy.Action("DestroyEquipementIntervention", "Equipements"))
            )
)

 

And the EditorTemplate :

@model string
 
@(Html.Kendo().AutoComplete()
          .Name("ResponsableEntretienIntervention")
          .Filter(FilterType.StartsWith)
          .MinLength(0)
          .HtmlAttributes(new { style = "width:100%" })
          .DataSource(source =>
          {
              source.Read(read =>
              {
                  read.Action("ObtenirResponsable", "Equipements", new { area = "Maintenance" })
                       .Data("onAdditionalDataResponsableEntretienIntervention");
              })
              .ServerFiltering(true);
          })
)

I try with @(Html.Kendo().AutoCompleteFor(m => m)…  but it's worst.  Everything diseapear.

 

I think I see with Developers Tools is the ID and Name of the control change for this (the name get _ and repeat) :

 

<input id="ResponsableEntretienIntervention_ResponsableEntretienIntervention" name="ResponsableEntretienIntervention.ResponsableEntretienIntervention" style="" type="text" value="" data-role="autocomplete" class="k-input" autocomplete="off" role="textbox" aria-haspopup="true" aria-disabled="false" aria-readonly="false" aria-owns="ResponsableEntretienIntervention_ResponsableEntretienIntervention_listbox" aria-autocomplete="list" data-bind="value:ResponsableEntretienIntervention.ResponsableEntretienIntervention">

 

 

 

Louis
Top achievements
Rank 1
Iron
Iron
Iron
 answered on 20 Aug 2019
5 answers
1.0K+ views

For our application, we were using Kendo Grid with a class named Properties that stored column information:

public class Properties
{
   
public string Id { get; set; }
public object PROPERTY_0 { get; set; }
public object PROPERTY_1 { get; set; }
...
public object PROPERTY_43 { get; set; }

In order to sort and filter rows, we used the ToDataSourceResult extension. However, this system limited us to a hardcoded maximum number of columns. We have refactored the code to use a List<Dictionary<string, dynamic>> instead, which allows us to store results in key value pairs in a list thus allowing an arbitrary maximum number of columns.

Unfortunately, I have not been able to find any documentation on whether ToDataSourceResult is able to parse data in this format, or any format aside from the previous one. While it is possible to recreate the logic for filtering, grouping, and sorting, it would take a good deal of time to do so. Is there any way to use ToDataSourceResult instead? We are storing values in a dictionary with PROPERTY_x as a string key and a dynamic value.

Boyan Dimitrov
Telerik team
 answered on 19 Aug 2019
7 answers
447 views
I am currently using a multiselect for, which populates the list by means of a datasource.

The problem is that when typing in the input is not taking empty spaces, even when typing the multiselect space bar does not take them, why could this happen?
Ivan Danchev
Telerik team
 answered on 19 Aug 2019
9 answers
2.9K+ views
Hello,

I want to filter a Grid with Bound bool field by using a dropdown instead of normal radiobuttons.
Is this possible at all?

I have tried settings filterable.UI as follows:

columns.Bound(c => c.UnServiceable)
    .Title("U/S")
    .ClientTemplate("#if(UnServiceable) { #Yes# } else { #No# }#")
    .Filterable(filter => filter
        .Messages(m => m.Info(Strings.Filter_UnServiceable_Message))
        .UI("boolAsDropdown"))
    .Width(100);


However, the ​boolAsDropdown​ javascript function is never called. It seems to be unable to call this when using a boolean field as data column.
The same method is working fine with other column types (int, string).

If anyone could help me with this issue, this would be great.

Thank you in advance,
Nick
Alex Hajigeorgieva
Telerik team
 answered on 19 Aug 2019
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
Licensing
Rating
ScrollView
ButtonGroup
CheckBoxGroup
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
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
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?