Telerik Forums
UI for ASP.NET MVC Forum
1 answer
262 views
Hello,

I am trying to set marks on a marker layer via JSON returned from my MVC controller.  I am capturing an onCriteriaChange event from a ListView.  In the event handler function I am try the following

var mapData = $('#map').data('kendoMap');
        mapData.layers[1].dataSource = new kendo.data.DataSource({
            transport: {
                read: {
                    url: ('@Url.Action("getMapData")'),
                    dataType: "json",
                    data: { customerId: customer.Id }
                }
            }
        });
        mapData.layers[1].dataSource.read();

My declaration code is 

$("#map").kendoMap({
                          center: [30.268107, -97.744821],
                          zoom: 15,
                          layers: [{
                              type: "tile",
                              urlTemplate: "http://#= subdomain #.tile2.opencyclemap.org/transport/#= zoom #/#= x #/#= y #.png",
                              subdomains: ["a", "b", "c"],
                              attribution: "© <a href='http://osm.org/copyright'>OpenStreetMap contributors</a>." +
                                           "Tiles courtesy of <a href='http://www.opencyclemap.org/'>Andy Allan</a>"
                          },
                          {
                              type: "marker",
                              locationField: "latlng",
                              titleField: "name",
                              
                          }]
                      });

so you can see the layer already exists.  I just want to set a marker for the lat, long returned by my controller.  

I can verify that my controller is producing JSON (see attached screenshot).   But the markers do not show. Am I doing this correctly? Any help would be appreciated.

T. Tsonev
Telerik team
 answered on 20 Jun 2014
8 answers
532 views
Hi,

I was using telerik for asp.net Ajax, and now I am using it's "evolution", telerik for asp.net MVC for a new website.

But I can't find how to export directly as it is displayed, with filter/group/order?

How can we do this?
Paul
Top achievements
Rank 1
 answered on 19 Jun 2014
1 answer
182 views
Hello ,
maybe you can help me with some issue.

I use kendo grid, I have grid with
aggregates data, and it looks like that:

 Grid:
(attach as grid.jpg)

Aggregates: (I don't use all the aggregates)
(attach as Aggregates.jpg)

I save the grid state (paging, grouping,
sorting, filtering and aggregates) in cookie as (Java Script):

var gridState = {           
       page: dataSource.page(),           
       pageSize: dataSource.pageSize(),           
       sort: dataSource.sort(),           
       group: dataSource.group(),
       filter: dataSource.filter(),
      aggregates: dataSource.aggregates()
        };

Cookie (JSON) (Result of saving):
{"page":1,"pageSize":11,"group":[{"field":"Modality","dir":"asc","aggregates":[{"field":"Space","aggregate":"count"},{"field":"Priority","aggregate":"min"},{"field":"Priority","aggregate":"max"},{"field":"Priority","aggregate":"count"},{"field":"Priority","aggregate":"average"}]}],"aggregates":{"Priority":{"min":1,"max":4,"count":148,"average":3.0135135135135136},"Space":{"count":148}}}

And I try to restoring the grid from
cookie that I already save, I loaded it like that:

Restoring the grid state: (paging, grouping , sorting and filtering)
if (gridState!= '' && gridState!= null) {   
      grid.dataSource.query(gridState);


But unfortunately is not work when I use
aggregate, an exception was throw:
"Uncaught ReferenceError: count is not defined"

And I don't understand it because I have count:
(attach as count.jpg)

Anyway those errors occurs just when I started use aggregates. before it, everything work just fine!

Thanks in advance.

Oren.
Alexander Popov
Telerik team
 answered on 19 Jun 2014
1 answer
142 views
Hello,

I am stuck in one date picker selection. I want to select a date picker. When selection the date , I want to select the beginning of the date at the label. Like if i select 17 June 2014 which is Tuesday, I want to populate 16 June 2014 (Monday). Similarly, If i choose 19 June 2014(Thursday), I want to populate 16 June(Monday). Whatever date I pick, I want the Monday date to populate in the date picker label.
Kiril Nikolov
Telerik team
 answered on 19 Jun 2014
2 answers
707 views
Hi!

When I try to filter a column of type DateTimeOffset, I get an error like: "System.InvalidCastException: Invalid cast &quot;System.DateTime&quot; to quot;System.DateTimeOffset&quot;."

Please tell me how to solve this problem. Thank you!
Aleksey 311
Top achievements
Rank 1
 answered on 18 Jun 2014
5 answers
212 views
Hi!

Is it possible to have a sparkline inside a listview HTML template?
If so, what is the best practice regardning binding it to data?

Regards,
Per
Iliana Dyankova
Telerik team
 answered on 18 Jun 2014
3 answers
94 views
Hello,

I have downloaded UI for ASP.NET MVC Q1 2014, and built a sample project
(unfortunately, i'm not able to attach project size more than 2MB)

On last page of the grid I get displace of headers and table contents:



Would be glad to receive your kind assistance

Shabtai
Dimo
Telerik team
 answered on 18 Jun 2014
1 answer
183 views
I have defined a DropDownListFor in my view as follows:
@(Html.Kendo().DropDownListFor(m=>m.BusinessUnitId)
 .OptionLabel("Select item...")
 .BindTo(new SelectList(Model.BusinessUnitList, "Key", "Value"))
)
where BusinessUnitList is a Dictionary<string, string> of value BusinessUnitIds and their descriptions.
Everything looks good on the screen and I can select a value and see its value via jQuery using: $("#BusinessUnitId").val()
However, when I try to submit the form, I get the following error:
System.ArgumentNullException
"Value cannot be null. Parameter name: items"
Alexander Popov
Telerik team
 answered on 18 Jun 2014
4 answers
745 views
I'm trying to get search results to display in a tooltip window.  I've got the tooltip working to pass my search text to my partial view, but it only works on the first call.  Every time the tooltip loads again, the results are the same, because the content is never reloaded.  Is there a way to not cache what comes back from the tooltips .LoadContentFrom function, so that I can pass new parameters back to the partial view each time?
Here is what I have for the tooltip.
What I'd like is that everytime the tooltip is show, the LoadContentFrom is called.
@(Html.Kendo().Tooltip()
    .For("#searchButton")   
    .LoadContentFrom("AllSearch", "Search", new { area = "" })   
    .ShowOn(TooltipShowOnEvent.Click)
    .Position(TooltipPosition.Bottom)
    .AutoHide(false)
    .Width(600)
    .Height(600)
    .Callout(true)
    .Animation(true)   
    .Events(e =>
        {
            e.RequestStart("requestStart");           
        })
)

<script>
    function requestStart(e) {
        var st = $("#searchText").val();
 
        e.options.data = {
            searchText: st
        }
    }
     
</script>
Rosen
Telerik team
 answered on 17 Jun 2014
4 answers
521 views
I have looked at similar postings but I am unable to figure it out. The json data is displaying as text, not through the view

CONTROLLER
[HttpPost]
        public JsonResult ReportsPhoneSupport([DataSourceRequest] DataSourceRequest request, ReportsPhoneSupport model)
        {
            string[] userIds = model.UserId.Split(',');
            ReportPhoneSupportResultTypedView results = new ReportPhoneSupportResultTypedView();
            foreach (string userId in userIds)
            {
                int iUserId = 0;
                if (Int32.TryParse(userId, out iUserId))
                {
                     
                    RetrievalProcedures.FetchReportPhoneSupportResultTypedView(results, model.FromDate, model.ToDate, iUserId);
                }
            }
            var Results = from Reslt in results
                          select new{
                              ActivityDate = Reslt.ActivityDate,
                              Action = Reslt.Action,
                              Assignment = Reslt.Assignment,
                              Description = Reslt.Description,
                              Result = Reslt.Result,
                              ToFrom = Reslt.ToFrom
                          };
            return Json(Results.ToDataSourceResult(request, ModelState), JsonRequestBehavior.AllowGet);
             
        }
VIEW
@{
    ViewBag.Title = "ReportsPhoneSupport";
}
 
<h2>ReportsPhoneSupport</h2>
 
 
@(Html.Kendo().Grid<ZoomAudits.DAL.TypedViewClasses.ReportPhoneSupportResultRow>()
    .Name("grid")
     
    .Columns(columns =>
    {
        columns.Bound(m => m.ActivityDate).Format("{0:MM/dd/yyyy}").Title("Activity Date");
        columns.Bound(m => m.Assignment).Title("Assignment");
        columns.Bound(m => m.Action).Title("Action");
        columns.Bound(m => m.ToFrom).Title("ToFrom");
        columns.Bound(m => m.Result).Title("Result");
        columns.Bound(m => m.Description).Title("Description");
    })
     
    //.AutoBind(true)
    .Pageable()
    .Sortable()
    .Scrollable()
    .Filterable()
     
    .DataSource(dataBinding => dataBinding
        .Ajax()
        .ServerOperation(false)
        .PageSize(20)
             
                .Read(read => read.Action("ReportsPhoneSupport", "ReportsPhoneSupport"))
     )
)
Example of displayed data 
{"Data":[{"ActivityDate":"\/Date(1398866129000)\/","Action":"Call Placed","Assignment":9538,"Description":"Spoke with insured, Krsto Djurovski (Chris),
Lee
Top achievements
Rank 1
 answered on 16 Jun 2014
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
MultiColumnComboBox
Dialog
DropDownTree
Checkbox
Slider
Switch
Notification
Accessibility
ListView (Mobile)
Pager
ColorPicker
DateRangePicker
Wizard
Security
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
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
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?