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

 Hi there,

We have developed a website for a client who requires file upload functionality. In order to provide this, we have used the Telerik MVC Upload control operating in Async mode.

The client has commissioned an external testing company who have raised a bug about the exclamation mark icon, which is displayed when a file fails validation. This only appears to happen at certain screen resolutions.

I have been able to reproduce this in your demo - see attached screenshot.

Steps:

  1. Use an Upload control in asynchronous mode which has validation e.g. only PDFs allowed
  2. Select an invalid file - the exclamation mark should be displayed
  3. Shrink the screen width - the icon will at different times be clipped to the right or left depending on the resolution.

Thanks,

Paul

Ivan Danchev
Telerik team
 answered on 06 Apr 2017
2 answers
770 views

I am attempting to change the chart theme dynamically, but am having some trouble.

I am successfully able to change the Kendo.[theme].min.css sheet on a dropdownlist that dynamically changes the site's kendo widgets. However, this does not propagate to the charts inside the site, but instead sets the theme to "default". I have also tried to set the theme via JavaScript to no avail.

However, if i set the theme statically in the widget using the html helper, it obviously works and changes the theme.

Any ideas?

$("#chart").data("kendoChart").options.theme = localStorageItem;
//localStorageItem = "flat" for example.
Chris
Top achievements
Rank 1
 answered on 05 Apr 2017
2 answers
213 views

Hi,

How does it actually work? I mean Kendo.Mvc.UI.Fluent.ChartLabelsBuilderBase.VisibleHandler() method. and how a handler used as the parameter should be implemented/used. I would expect that such a handler returns true or false and controls associated labels visible attribute but I couldnt achieve this.

see a part of my code below...

 

series
.Column("StatsFaultsInInspections", "ARGB_RiskColorHexString", "RiskLevelName")
     .Labels(x => x.Position(ChartBarLabelsPosition.OutsideEnd)                                   
     .Visible(true)  
     .Template("#= value # Tags\\n\\r#= kendo.format('{0:n2}', dataItem.StatsFaultsInInspectionsPercentOfInSameRisk) #%")
     .VisibleHandler("labelsVisibility")
)
.Name("Tags with faults");

 

Pawel Ch
Top achievements
Rank 1
 answered on 05 Apr 2017
0 answers
62 views

Hey out there,

currently we try to switch our Grid (old Telerik Grid)  and its functionality to the Kendo Grid.. Everythings works pretty fine except PDF export.

https://pastebin.com/z5AG95hx 

This snippet demonstrates the way the grid is embedded. Excel Export works fine. PDF Export returns empty pdf file. If I force proxy I get the following error:

n caught TypeError: t.split is not a function

    at n (kendo.all.js:3292)

If I don't use a proxy I get an empty file and no action seems to get called.

Whats the secret? Thanks in advance..

 

 

André
Top achievements
Rank 1
 asked on 05 Apr 2017
8 answers
461 views

I am trying to implement a Kendo Map, using ASP MVC, using Read, called from javascript.  The call works, I get my data back through the Controller, but no matter what I try, I can't seem to get the right value into the LocationField, so the bubbles on my map do not work.

Here is the cshtml:

@(Html.Kendo().Map()
.Name("crimemapping_results")
.Center(Model.DefaultLatitude, Model.DefaultLongitude)
.Zoom(3)
 .MinZoom(3)
 .Wraparound(true)
.Layers(layers =>
{
    layers.Add()
       .Type(MapLayerType.Tile)
       .UrlTemplate("http://#= subdomain #.tile.openstreetmap.org/#= zoom #/#= x #/#= y #.png")
       .Subdomains("a", "b", "c")
       .Attribution("© <a href='http://osm.org/copyright'>OpenStreetMap contributors</a>");
    layers.Add().AutoBind(false)
       .Type(MapLayerType.Bubble)
       .Style(style => style
       .Fill(fill => fill.Color("#00f").Opacity(0.4))
       .Stroke(stroke => stroke.Width(0))
       )
         .DataSource(dataSource => dataSource
         .Read(read => read.Action("CrimeMapping_Map", "Home").Data("map_get"))
       )
         .LocationField("latlng")
         .ValueField("DataCount");
      })
         .Events(events => events
         .ShapeMouseEnter("onShapeMouseEnter")
         .Reset("onReset")
      )
)

 

In the javascript, I just do a read:  $("#crimemapping_results").data("kendoMap").layers[1].dataSource.read();

This goes through my controller to my object model, where I return a single record, with the following fields:

public List<MapData> GetMap(string pJSON, int pUserId)
{
    dynamic _Json = JObject.Parse(pJSON);
    var _Results = new List<MapData>();
    var _Result = new MapData();
    _Result.Jurisdiction = "Holland City";
    _Result.lat = Convert.ToString(42.787523);
    _Result.lng = Convert.ToString(-86.108930);
    _Result.latlng = "[" + _Result.lat + "," + _Result.lng + "]";
    _Result.DataCount = 25;
    _Results.Add(_Result);
 
    return _Results;
}

 

I have tried all kinds of formats for the latitude and longitude.  The values lat and lng are doubles, but I have also tried them as strings, but I get the same result.  LocationField in the cshtml control only takes one argument.  I have tried "latitude,longitude" as a string, then I tried it with [ ] 's on it.  What happens is the whole latlng value ends up in the object under the location, lat value, if I look at the map control during runtime.

I put a console.log on hover to see what 'e' is, for the point on the map and here is what that looks like (file attached).  It shows my object, with my latlng value all thrown into location lat.  What value should go into LocationField, so that it ends up a latitude and l

 

 

Stephen
Top achievements
Rank 1
Iron
 answered on 05 Apr 2017
1 answer
130 views
is there a way to do Annotations on seriesLine or ColumnSeries (my first choice) or even scatterLine?
I am looking for putting a vertical line with text onto my chart.
Boyan Dimitrov
Telerik team
 answered on 05 Apr 2017
1 answer
503 views

Hi, anyone know how can I get my grid's current row being edited?  I would do this from an event for a custom column editor. The whole idea is that I have a grid with inline editing and use an autocomplete editor template. During the autocomplete's select event I want to populate multiple fields of my grid's row. I can't seem to get a reference to the grids row.  All the examples I see say to use the 'select()' method, but my grid has row selection disabled (on purpose). Here is an example of a snippet that doesn't work:

var grid = $('#mygrid').data('kendoGrid');
var selectedItem = grid.dataItem(grid.select());

 

Any suggestions would be greatly appreciated!

Stefan
Telerik team
 answered on 05 Apr 2017
14 answers
702 views

In the Kendo Editor documentation it says the following:

The editor value will be posted as a string and mapped to a variable with the name of the widget. Note that the posted value is HTML-encoded by default, in order to circumvent the ASP.NET request validation. In order to decode the value, use the HttpUtility.HtmlDecode method. (http://docs.telerik.com/kendo-ui/aspnet-mvc/helpers/editor/overview)

 This works fine when I place the editor in a normal view such as Edit.cshtml; however, when I use a Grid and provide a custom popup editor template, I cannot use a Kendo Editor without specifying [AllowHtml] on the model. Why is this?

Leo
Top achievements
Rank 1
 answered on 04 Apr 2017
8 answers
128 views

When the page loads that has my Splitter on it, it shows up as un-formatted.  After a second or two, the page then changes to show the correct splitter panel layout.  How can I change this so that it doesn't show the un-formatted  splitter first?  See attached screen shots...

 

Joe
Top achievements
Rank 1
 answered on 04 Apr 2017
18 answers
535 views

Hi,

 

Trying to create a TreeList view, but the data set is too large. exceed maxJson limit.  

So I'd like to load on demand.  Bring back the 1st level where the parentId string is null and then as each node is cliked have it return the next set of data.  I've a similar thread where the suggestion was to look at the emploeedirectory example, but don't see how that works per say. 

While trouble-shooting have noticed that trying to restrict the intial data request to just the top items where parentId is null does not work.  Tried to set default value for parentId as well but still does not work - "No Records to display"

However, changing the default parentId to a value and retricting the data query to that same value does return the items where their parent is the specified default value. 

I'm assuming there would be an inital query that brings back the top level items, but how would it show if there are sub items to select?  

Secondly, when a node is clicked would there need to be a clicked event that calls the controller to update the TreeList?  

Here is the controller method:

public ActionResult GetBoms([DataSourceRequest] DataSourceRequest request)
        {
            var db = new EmsDashDev();
            var results = db.NHAItems.ToList<NHAItems>();
            var results1 = results.ToTreeDataSourceResult(request,
                e => e.ComponentNumber,
                e => e.NextHigherAssembly);
            return Json(results1);
        }

And the view code

@(Html.Kendo().TreeList<EMSCommitScheduleApp.Models.NHAItems>()
    .Name("treelist")
    .AutoBind(true)
    
    .Columns(columns =>
    {
        columns.Add().Field(e => e.ComponentNumber).Width(280);
        columns.Add().Field(e => e.ItemNumber).Width(160);
        columns.Add().Field(e => e.Description);
        columns.Add().Field(e => e.Qty).Width(80);
        columns.Add().Field(e => e.NextHigherAssembly).Width(280);
        columns.Add().Field(e => e.LevelZeroAssembly);
        columns.Add().Field(e => e.AssemblyIndicator).Title("Make");
    })
    .Filterable()
    .Sortable()
    .DataSource(dataSource => dataSource
        .Read(read => read.Action("GetBoms", "Home"))
        .ServerOperation(true)
        .Model(m => {
            m.Id(f => f.ComponentNumber);
            m.ParentId(f => f.NextHigherAssembly);
            m.Expanded(false);
            m.Field(f => f.ComponentNumber);
            m.Field(f => f.ItemNumber);
            m.Field(f => f.Description);
            m.Field(f => f.Qty);
            m.Field(f => f.NextHigherAssembly);
            m.Field(f => f.LevelZeroAssembly);
            m.Field(f => f.AssemblyIndicator);
        })
        
    )
    .Height(540)
)

binta
Top achievements
Rank 1
 answered on 04 Apr 2017
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?