Telerik Forums
UI for ASP.NET MVC Forum
3 answers
124 views

Hello,

I cannot get working hiding the address bar for my mobile hybrid application on the mobile device (Samsung Galaxy S10).
See attached screenshot.

 

Here is my initialization code of the mobile application:

[code]

@(Html.Kendo().MobileApplication()
      .ServerNavigation(true)
      .Layout(Model)
      .HideAddressBar(true)        
      .Events(e => e.Init("onInitApplication"))
      .Transition("slide")
       .Skin("nova"))

[/code]

Any ideas what I do wrong. Is there any "workaround" to hide the address bar on the mobile device (iphone, android phones, ...)

Greetings

Ivan Danchev
Telerik team
 answered on 30 Jan 2020
2 answers
84 views

Hello,

 

is it possible to open a modal view and show a remote HTML page of PDF Document inside the modal view content?
I only see, that you can add own html in the "Content" Block.

 

If its not possible with the modal view, is there any control that allows me to do that. I would like to show HTML pages or PDFs in a "non fullscreen window", which should be on top of my main window. So modal window would be perfect ...

 

Greetings

Dimitar
Telerik team
 answered on 30 Jan 2020
2 answers
423 views

I have an in-cell editable grid grid in which the values available in a grid foreign key column should be filtered by an input a user has previously selected. In our case a user picks a location from a kendo dropdown (outside of the grid) and that value filters what products should appear in the product foreign key column.

The general idea is that location 1 might have products A, B, and C. But Location 2 might only have products C and D. If the user picks location 1 then the multiselect bound to the foreign key column should only show A, B, and C, and if the user picks location two then they only see C and D when the dropdown is rendered.

I've seen examples where you change the editor template for Foreign Key to bind the dropdown to a remote datasource. In that case the read passes in whatever data the server needs for filtering (location id in our case) as data to the controller read call (https://www.telerik.com/forums/filtered-foreign-key-drop-down-list-based-on-another-key). The server then returns the filtered list of select list items which are bound to the dropdown. 

We'd really like to avoid the case where every time a user opens the dropdown we hit the server. Is there any way to do this filtering on the client side?

I'm envinsioning a case where we: 

  • Send down all of the associations of locationId to productId and bind this to a javascript object
  • Bind the column to a list of all possible products (so the dropdown template on the column object has all possible options)
  • When the user clicks on the cell and the grid renders the dropdown we (in a javascript function) remove the values that aren't valid for the existing location 

Is there an event we could bind to, or a way we could customize the editor template to achieve our desired result, specifically to filter the items in the dropdown without binding to a remote datasource?

Thanks!

 

Aleksandar
Telerik team
 answered on 29 Jan 2020
5 answers
146 views

Hi guys,

 

it seems the Drawer Control is broken since a few Kendo Versions in Internet Explorer 11. I am using currently the latest 2020 version of the Kendo controls (v2020.1.114). The bug seems to be introduced somewhere 2019, I assume. For example, version v2019.3.1023 also has this bug.

 

How to reproduce:

Just click on the Drawer-Icon (to open the Navigation), but nothing happens. This problem only happens in Internet Explorer 11 (Dev Tools: Emulation -> Apple Safari ). In Chrome and Edge it seems to work fine, also on my mobile device (Samsung Galaxy S10).

In older Kendo version (e.g: 2018.1.221) it works fine, but there are other problems which are fixed in the latest 2020 version, so I cannot step back...

 

Thanks for your help,

Greetings

BigzampanoXXl
Top achievements
Rank 1
 answered on 28 Jan 2020
3 answers
736 views

Hi Guys,

A quick one: I understand the concept of grabbing the grid state via "grid.getOptions", then persisting this, and then applying it again via "grid.setOptions" on form refresh to keep the users' sort/filter/column options, etc between sessions. There are posts and help for this already.

 

My question is this:

  • In our situation, we do the above persistence, and store the options string somewhere (e.g. database).
  • However, we may well change the set of columns that the grid needs to display when we do an application version update. It's likely that we would remove, or add columns for example.
  • So, if we have try to apply an options set to the grid that has some columns missing or added since the "save" of the options... what happens?

Does it:

  • Robustly (silently ignore) options we are trying to apply for columns that no longer exist in the grid?
  • Robustly (apply a default) for columns that do not have any options being applied? (e.g. newly added columns).
  • Throw errors, but still render?
  • Fail to render with errors?
  • Something else?

cheers

Nick

 

 

 

hunidoc.com developers
Top achievements
Rank 1
 answered on 28 Jan 2020
1 answer
549 views

I am getting "Uncaught Error: Invalid template:" while trying to request the ".cshtml" page which contains the Kendo Grid (Column-Responsive). We used column responsive template in this grid. I am looking for the solution for this error since couple of hours now but I do not able to resolve it. Please have a look at the below response error message along with the HTML Code.

 

Uncaught Error: Invalid template:'
<div class="container-fluid" onclick="window.location='http://dev.newsalesbook.abc.com/Account/AccountDetail?AccountID=#=data.AccountID #&BusinessUnitID=#=data.BusinessUnitID #'">
   <div class="row">
      <div class="col-xs">
         <label style="font-size:17px; color:rgb(5,69,126); font-weight:bold">#=nullString(data.Name)#</label>
      </div>
   </div>
   <div class="row">
      <div class="col-xs">
         <label class="label-md-bold">Business Unit:</label>
      </div>
      <div class="col-xs">
         <label class="label-md">#=nullString(data.BusinessUnit)#</label>
      </div>
   </div>
   <div class="row">
      <div class="col-xs">
         <label class="label-md-bold">Account Type:</label>
      </div>
      <div class="col-xs">
         <label class="label-md">#=nullString(data.AccountType)#</label>
      </div>
   </div>
   <div class="row">
      <div class="col-xs">
         <label class="label-md-bold">Account#:</label>
      </div>
      <div class="col-xs">
         <label class="label-md">#=data.AccountNo#</label>
      </div>
   </div>
   <div class="row">
      <div class="col-xs">
         <label class="label-md-bold">Parent Account:</label>
      </div>
      <div class="col-xs">
         <label class="label-md">#=nullString(data.ParentAccount)#</label>
      </div>
   </div>
   <div class="row">
      <div class="col-xs">
         <label class="label-md-bold">OS#:</label>
      </div>
      <div class="col-xs">
         <label class="label-md">#=data.OutsideSalesNo#</label>
      </div>
   </div>
   <div class="row">
      <div class="col-xs">
         <label class="label-md-bold">Outside Sales Name:</label>
      </div>
      <div class="col-xs">
         <label class="label-md">#=nullString(data.OutsideSalesName)#</label>
      </div>
   </div>
   <div class="row">
      <div class="col-xs">
         <label class="label-md-bold">IS#:</label>
      </div>
      <div class="col-xs">
         <label class="label-md">#=data.InsideSalesNo#</label>
      </div>
   </div>
   <div class="row">
      <div class="col-xs">
         <label class="label-md-bold">IS Name:</label>
      </div>
      <div class="col-xs">
         <label class="label-md">#=nullString(data.InsideSalesName)#</label>
      </div>
   </div>
   <div class="row">
      <div class="col-xs">
         <label class="label-md-bold">Date Created:</label>
      </div>
      <div class="col-xs">
         <label class="label-md">#=formatDate(data.DateCreated)#</label>
      </div>
   </div>
   <div class="row">
      <div class="col-xs">
         <label class="label-md-bold">Account Owner:</label>
      </div>
      <div class="col-xs">
         <label class="label-md">#=nullString(data.OwnerName)#</label>
      </div>
   </div>
</div>
' Generated code:'var $kendoOutput, $kendoHtmlEncode = kendo.htmlEncode;with(data){$kendoOutput='\n\n   
<div class="container-fluid" onclick="window.location=\'http://dev.newsalesbook.wesco.com/Account/AccountDetail?AccountID='+(data.AccountID )+'&BusinessUnitID='+(data.BusinessUnitID )+'\'">
   \n       
   <div class="row">
      \n\n           
      <div class="col-xs">\n                <label style="font-size:17px; color:rgb(5,69,126); font-weight:bold">'+(nullString(data.Name))+'</label>\n            </div>
      \n       
   </div>
   \n\n       
   <div class="row">
      \n           
      <div class="col-xs">\n                <label class="label-md-bold">Business Unit:</label>\n            </div>
      \n           
      <div class="col-xs">\n                <label class="label-md">'+(nullString(data.BusinessUnit))+'</label>\n            </div>
      \n       
   </div>
   \n\n       
   <div class="row">
      \n           
      <div class="col-xs">\n                <label class="label-md-bold">Account Type:</label>\n            </div>
      \n           
      <div class="col-xs">\n                <label class="label-md">'+(nullString(data.AccountType))+'</label>\n            </div>
      \n       
   </div>
   \n\n       
   <div class="row">
      \n           
      <div class="col-xs">\n                <label class="label-md-bold">Account'+$kendoHtmlEncode(</label>
      </div>
      <div class="col-xs">
         <label class="label-md">)+'=data.AccountNo';</label>
      </div>
   </div>
   <div class="row">
      <div class="col-xs">
         <label class="label-md-bold">Parent Account:</label>
      </div>
      <div class="col-xs">
         <label class="label-md">;$kendoOutput+='=nullString(data.ParentAccount)';</label>
      </div>
   </div>
   <div class="row">
      <div class="col-xs">
         <label class="label-md-bold">OS;$kendoOutput+=':</label>\n           
      </div>
      \n           
      <div class="col-xs">\n                <label class="label-md">'+(data.OutsideSalesNo)+'</label>\n            </div>
      \n       
   </div>
   \n\n       
   <div class="row">
      \n           
      <div class="col-xs">\n                <label class="label-md-bold">Outside Sales Name:</label>\n            </div>
      \n           
      <div class="col-xs">\n                <label class="label-md">'+(nullString(data.OutsideSalesName))+'</label>\n            </div>
      \n       
   </div>
   \n\n       
   <div class="row">
      \n           
      <div class="col-xs">\n                <label class="label-md-bold">IS'+$kendoHtmlEncode(</label>
      </div>
      <div class="col-xs">
         <label class="label-md">)+'=data.InsideSalesNo';</label>
      </div>
   </div>
   <div class="row">
      <div class="col-xs">
         <label class="label-md-bold">IS Name:</label>
      </div>
      <div class="col-xs">
         <label class="label-md">;$kendoOutput+='=nullString(data.InsideSalesName)';</label>
      </div>
   </div>
   <div class="row">
      <div class="col-xs">
         <label class="label-md-bold">Date Created:</label>
      </div>
      <div class="col-xs">
         <label class="label-md">;$kendoOutput+='=formatDate(data.DateCreated)';</label>
      </div>
   </div>
   <div class="row">
      <div class="col-xs">
         <label class="label-md-bold">Account Owner:</label>
      </div>
      <div class="col-xs">
         <label class="label-md">;$kendoOutput+='=nullString(data.OwnerName)';</label>
      </div>
   </div>
</div>
Veselin Tsvetanov
Telerik team
 answered on 28 Jan 2020
1 answer
131 views

I have a CRUD MVC app that is working with no problem. My new project is to add the Telerik grid and batch editing. Well, when I go to add the items, I notice I can straight add the controller as a Telerik form with a grid already made. I thought, wonderful! Now I'm wondering how do I add my links to it that edit and update and details. Do I add the links on the Grid views page? Or do I need to make a separate controller for it? Or do I need to just make a MVC read/write form and add the grid by code? 

 

I'm a C# developer, and I'm not educated well in Json/Ajax/Java so please bear with me. 

Petar
Telerik team
 answered on 28 Jan 2020
1 answer
146 views

Running the scheduler app locally and it connects fine to my database and it works great.  When I upload it to our IIS server the page loads but there is no data.  When I try to create a new event and hit save the event window just sits there.  When I look at the console I see 'Tasks_Read 500 (Internal Server Error)' and that is really just it.

Here is my model:

using System.Collections.Generic;
using System.Linq;
using System.Web;
using Kendo.Mvc.UI;
 
namespace Calendar.Models
{
    public class TaskViewModel : ISchedulerEvent
    {
        public int TaskID { get; set; }
        public string Title { get; set; }
        public string Description { get; set; }
 
        private DateTime start;
        public DateTime Start { get; set; }
 
        private DateTime end;
        public DateTime End { get; set; }
 
        public string RecurrenceRule { get; set; }
        public int? RecurrenceID { get; set; }
        public string RecurrenceException { get; set; }
        public bool IsAllDay { get; set; }
        public int? OwnerID { get; set; }
        public string EndTimezone { get; set; }
        public string StartTimezone { get; set; }
         
    }
}

 

Here is the Read Section on my controller:

public ActionResult Tasks_Read([DataSourceRequest]DataSourceRequest request)
{
    using (var sampleDB = new SampleEntities())
    {
 
        IQueryable<TaskViewModel> tasks = sampleDB.Tasks.ToList().Select(task => new TaskViewModel()
        {
            TaskID = task.TaskID,
            Title = task.Title,
            // Specify the DateTimeKind to be UTC.
            Start = DateTime.SpecifyKind(task.Start, DateTimeKind.Utc),
            End = DateTime.SpecifyKind(task.End, DateTimeKind.Utc),
            Description = task.Description,
            IsAllDay = task.IsAllDay,
            RecurrenceRule = task.RecurrenceRule,
            RecurrenceException = task.RecurrenceException,
            RecurrenceID = task.RecurrenceID,
            OwnerID = task.OwnerID,
            StartTimezone = task.StartTimezone,
            EndTimezone = task.EndTimezone
        }).AsQueryable();
 
        return Json(tasks.ToDataSourceResult(request));
    }
}

 

And here is the code in my view:

@using Calendar.Models
@{
    var name = ViewBag.Name;
    //ViewBag.Title = "Home Page";
    }
 
@name
 
 
@(Html.Kendo().Scheduler<TaskViewModel>()
                                .Name("scheduler")
                                .Date(DateTime.Today)
                                .StartTime(new DateTime(2019, 12, 01, 7, 00, 00))
 
                                .Height(600)
                                .Views(views =>
                                {
                                    views.DayView();
                                    views.WeekView();
                                    views.MonthView(monthView => monthView.Selected(true));
                                    views.AgendaView();
                                })
 
 
                                .DataSource(d => d
                                 
                                .Model(m =>
                                {
                                    m.Id(f => f.TaskID);
                                    m.Field(f => f.OwnerID).DefaultValue(1);
                        // Set the recurrence ID field from the model.
                        m.RecurrenceId(f => f.RecurrenceID);
 
 
                                })
                                .Read("Tasks_Read", "Home")
                                .Create("Tasks_Create", "Home")
                                .Destroy("Tasks_Destroy", "Home")
                                .Update("Tasks_Update", "Home")
                            )
)


Veselin Tsvetanov
Telerik team
 answered on 27 Jan 2020
2 answers
64 views

I have the following Menu inside a ResponsivePanel:

@(Html.Kendo().ResponsivePanel()
    .Name("navPanel")
    .Breakpoint(768)
    .Orientation("top")
    .AutoClose(false)
    .HtmlAttributes(new {@class = "navbar-left"})
    .Content(Html.Kendo().Menu()
        .Name("menu")
        .HtmlAttributes(new { @class = "row"})
        .Items(items =>
        {
            ... various items ...
        }).ToHtmlString())
    )

 

Everything works great in a large view, but when I switch to mobile, the panel does it's thing and shows the hamburger, but when I click, the menu won't stay open.  It opens briefly then closes.

I've noticed the following "warning" in the browser console:
Ignoring ‘preventDefault()’ call on event of type ‘touchstart’ from a listener registered as ‘passive’.

Does anybody have any ideas or experience with this?

Thanks!

Kevin

 

Dimitar
Telerik team
 answered on 27 Jan 2020
3 answers
128 views

After upgrading to 2019.3.1023, server filtering fails after the first search. Chrome console shows the following error. The control is no longer functional after this error occurs. Any ideas?

VM1837:3 Uncaught TypeError: Cannot convert undefined or null to object
    at eval (eval at compile (kendo.all.min.js:1), <anonymous>:3:55)
    at init._renderHeader (kendo.all.js:32395)
    at init._render (kendo.all.js:32492)
    at init.refresh (kendo.all.js:32517)
    at init.proxy (jquery-3.4.1.js:10502)
    at init.trigger (kendo.all.js:164)
    at init._process (kendo.all.js:7522)
    at init.success (kendo.all.js:7257)
    at success (kendo.all.js:7151)
    at Object.n.success (kendo.all.js:6057)

Ivan Danchev
Telerik team
 answered on 24 Jan 2020
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?