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

I had a subcription 5 years ago and have decided to renew my subscription to get the latest version of Kendo for MVC. Our code uses bootstrap as well as Kendo, with JQuery. I was expecting to be able to upgrade all of these to their latest versions. However, I notice that the JQuery file used by Kendo is still 1.12.4, but Visual Studio is referenceing 3.4.1 by default. 

Is it possible to ditch 1.12.4 and kendo work with 3.4.1?

 

Nikolay
Telerik team
 answered on 29 Aug 2019
2 answers
204 views

Hello everyone,

It's possible to apply a filter on one field automatically?  When I load the page I want one filter applied without the user have to do it each time.  Of course he can remove it.

 

See attachment.

 

Louis
Top achievements
Rank 1
Iron
Iron
Iron
 answered on 28 Aug 2019
3 answers
703 views

Hello, with my code below I want to populate the dropdown and the grid(with all rows), then if the user makes a selection in the dropdown I want the grid to be refreshed with the filtered rows. The NewPartsRead controller action does return the filtered rows, but the grid does not rebind to the filtered rows returned.

What am I doing wrong?

Index:

 @using (Html.BeginForm())
                {    <div class="demo-section k-content" style="padding:20px;">
                     
                        @(Html.Kendo().DropDownList()
                                                    .Name("EngMake")
                                                    .DataTextField("Text")
                                                    .DataValueField("Value")
                                                    .BindTo(Model.EngMakeList)
                                                    .SelectedIndex(0)
                                                    .OptionLabel("Select Engine Manufacturer")
                                                    .HtmlAttributes(new { style = "width:300px" })
                                                    .Filter(FilterType.Contains)
                        )

 

 

                    </div>

                         @(Html.Kendo().Grid(Model.NewParts)
                                           .Name("grid")
                                           .Columns(columns =>
                                           {
                                               columns.Bound(p => p.EngDescription);
                                               columns.Bound(p => p.PartType);
                                               columns.Bound(p => p.EngYear);
                                               columns.Bound(p => p.EngCylinders);
                                               columns.Bound(p => p.EngBore);
                                               columns.Bound(p => p.PartYears);
                                               columns.Bound(p => p.Partieb);
                                               columns.Bound(p => p.PartNotes);
                                           })
                                           .Pageable()
                                           .Sortable()
                                           .Scrollable()
                                           .Filterable()
                                           .HtmlAttributes(new { style = "height:550px;" })
                                           .DataSource(dataSource => dataSource
                                               .Ajax()
                                               .PageSize(20)
                                               .Read(read => read.Action("Index", "NewPartsRead"))
                                            )
                    )
                }

 

Controller:

  public class NewPartsController : Controller
    {
        // GET: NewParts
        public ActionResult Index()
        {
            var model = new NewPartsModel();
            return View(model);
        }
        [HttpPost]
        public ActionResult NewPartsRead(NewPartsModel newPartsModel)
        {
            newPartsModel.NewParts = newPartsModel.NewPartsRead(newPartsModel.EngMake);

            return Json(newPartsModel.NewParts);
        }
    }

 

Model:

 protected readonly NewPartsProvider newPartsProvider = new NewPartsProvider();

        public string EngMake { get; set; }

        public List<DataObjects.NewPart> NewParts { get; set; }

        public List<SelectListItem> engMakeList = new List<SelectListItem>();

        public IEnumerable<SelectListItem> EngMakeList { get; set; }

        public NewPartsModel()
        {
            foreach (var engMake in newPartsProvider.GetEngMakeList())
                engMakeList.Add(new SelectListItem() { Text = engMake, Value = engMake });

            EngMakeList = engMakeList;
            NewParts = newPartsProvider.GetNewParts();
        }

        public List<DataObjects.NewPart> NewPartsRead(string engMake)
        {
            List<DataObjects.NewPart> NewParts = new List<DataObjects.NewPart>();

            NewParts = newPartsProvider.GetNewPartsByMake(engMake);

            return NewParts;
        }

 

n/a
Top achievements
Rank 1
 answered on 27 Aug 2019
1 answer
152 views

Hello,

@(Html.Kendo().Grid<Myproject.Areas.Maintenance.ViewModels.EquipementsInterventions.EquipementInterventionModel>()
            .Name("EquipementIntervention")
            .Columns(columns =>
            {
                columns.Bound(p => p.NoReference).Width(60);
                columns.Bound(p => p.DateIntervention).Format("{0:yyyy-MM-dd}").Width(60).HtmlAttributes(new { style = "text-align:center" });
            })
            .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.Id(field => field.NoEquipementIntervention);
                    model.Field(field => field.NoReference).DefaultValue("Test");
                    model.Field(field => field.DateIntervention).DefaultValue(System.DateTime.Now);
                })
                .Read(read => read.Action("Read", "Equipements", new { id = Model.EquipementId }))
                .Create(create => create.Action("Create", "Equipements", new { id = Model.EquipementId }))
                .Update(update => update.Action("Update", "Equipements"))
                .Destroy(destroy => destroy.Action("Destroy", "Equipements"))
            )
)

I try to set a default value when I add a new item in my grid.  Even with a hard coded value like "Test".  I have the same situation with a DateTime? field until I remove the ?.  Any idea about the NoReference (string) field?

The model :

[Key]
public Guid NoId { get; set; }
 
[Required]
 
public string NoReference { get; set; }
 
[UIHint("Date")]
[Required]
public DateTime DateIntervention { get; set; }

 

The Grid :

 

 

THANK A LOT TO EVERYONE.

 

 

 

Viktor Tachev
Telerik team
 answered on 27 Aug 2019
1 answer
495 views

Hello, I was wondering if it was possible to to the use DateRangePicker for selecting a range of months instead of days. I currently have the following code:

@(Html.Kendo().DateRangePicker()
                                  .Name("MonthlyDatePicker")
                                  .HtmlAttributes(new { style = "width: 100%" })
                                  .Events(e => e.Change("onMonthlyChange"))
                                  .Start("year")
                                  .Depth("year")
                                  .Format("MM yyyy")
                                )

 

This code appears the way I want it to but does not allow the user to select a month. Any help is much appreciated. Thanks

 

Viktor Tachev
Telerik team
 answered on 27 Aug 2019
1 answer
1.1K+ views

Hi,

How do we set the series colours on an AJAX MVC Bar chart.

there is an option to set the colors but doesnt seem to matter what is entered nothing works

@(Html.Kendo().Chart<CML.Models.TopRequestersSample_Result>()
    .Name("TopRequesters")
    .SeriesColors()
    .Title("Top 10 Requesters by Sample Count")
    .Legend(legend => legend.Position(ChartLegendPosition.Bottom))
    .DataSource(ds => ds.Read(read => read.Action( "GetTopRequesters","Dash" ) ))
    .Series( s => { s.Bar( a => a.Total ); } )
    .CategoryAxis(ca => {
        ca
   .Categories( a => a.DisplayName )
   .Name( "Requester" );
    })

 

Nikolay
Telerik team
 answered on 23 Aug 2019
3 answers
420 views

I used the solution (slightly modified for my use case) referenced in the docs to add a new row when tabbing out of the last editable column in the last row. However, when the new row is added, the changes made to that last editable cell are lost. How do I prevent that from happening?

Here's my code. The "return false;" was necessary to prevent the focus going to the second column of the new row. The undesired behavior is occurring whether or not I include it.

$(document).ready(function () {
    var grid = $("#ReceivingReportGrid").data("kendoGrid");
 
    grid.tbody.on("keydown", function (e) {
        if (e.keyCode == 9) {
            if ($(e.target).closest('td').is(':nth-last-child(2)') && $(e.target).closest('tr').is(':last-child')) {
                grid.addRow();
                return false;
            }
        }
    });
});
Georgi
Telerik team
 answered on 23 Aug 2019
1 answer
190 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
233 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
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
ComboBox
Upload
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
Dialog
MultiColumnComboBox
DropDownTree
Checkbox
Slider
Switch
Notification
Accessibility
ListView (Mobile)
Pager
Security
ColorPicker
DateRangePicker
Wizard
Styling
Chat
DateInput
MediaPlayer
TileLayout
Drawer
SplitView
Template
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Badge
LinearGauge
ModalView
ResponsivePanel
TextArea
Breadcrumb
ExpansionPanel
Licensing
Rating
ScrollView
ButtonGroup
DropDownButton
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
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
SmartPasteButton
PromptBox
SegmentedControl
LLM Kit
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?