Telerik Forums
UI for ASP.NET MVC Forum
5 answers
336 views

When I pull up my map (Center is on Michigan) and scroll in or out with my mouse, the map centers on Africa and starts scrolling in or out from there.  It doesn't matter where the map is, scrolling with the mouse always moves the map over to Africa.  How do I fix that so that the map scrolls in or out, based on where the mouse pointer is?

Here is my cshtml razor object:

@(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")
      )
)
Alex Hajigeorgieva
Telerik team
 answered on 06 Apr 2017
3 answers
229 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
795 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
232 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
70 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
485 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
146 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
535 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
746 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
149 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
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
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?