Telerik Forums
UI for ASP.NET MVC Forum
2 answers
273 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
87 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
538 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
187 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
597 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
865 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
186 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
648 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
3 answers
534 views

Anyone know if there is a way to set the editor template of a grid at runtime? I'm trying to change the editing mode dynamically. e.g. from inline to popup and it seems to work fine, but it seems to clear my popup editor template. Here is an example of what I'm trying to do.

 

    grid.options.editable.mode = "popup";
    grid.options.editable.template = How can I set this at runtime?
    grid.editRow(row);

Gregory
Top achievements
Rank 1
 answered on 03 Apr 2017
1 answer
340 views

Hello everyone, I need to fill panel bar content with partial views. My current code is

 

@(Html.Kendo().PanelBar()
        .Name("reportFilters")
        .ExpandMode(PanelBarExpandMode.Multiple)
        .ExpandAll(true)
        .Animation(true)
        .Items(panelbar =>
        {
            foreach (IFilterCategory filterCateg in Model)
            {
                panelbar.Add()
                 .Text(filterCateg.DisplayName)
            .Content(@<text><div style="padding-top:5px;padding-left:5px;padding-right:5px">
@Html.Action(filterCateg.Action, filterCateg.Controller, new { filterCateg = filterCateg })</div></text>);
            }
        }
    )
)

 

and after reading the following post 

http://www.telerik.com/forums/what-is-the-syntax-to-open-a-mvc-partial-page-inside-a-pannel-bar#hmqmhkbB-kyThT8J06ygng

i tried to achieve client side rendering by using LoadContentFrom and .Action() without success. The best try was hitting the controller but the object filterCateg is null.

Thanks in advance.

Nencho
Telerik team
 answered on 03 Apr 2017
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?