Telerik Forums
UI for ASP.NET MVC Forum
5 answers
978 views
Kendo Grid with url takes to another kendo grid

I'm stuck with reading the querystring value from grid1 url to grid2 controller.. Any help appreciated..

Grid1

Index.cshtml
  columns.Bound(e => e.TCBSTAGE).Width(100).ClientTemplate("<a href='/" + "ControllerName" + "/Index?Batchno=#=BatchNo#'>#=TCBSTAGE#</a>");



Grid2Index.Cshtml

<script>$(function(){
   $("#grid").kendoGrid({
  dataSource: {
    transport: {
      read: {  
         url: "ControllerName2/GetRecords",
         contentType: "application/json",
         type: "POST"
      },
      parameterMap: function (options) {       
        return kendo.stringify(options);
      }
    },
    schema: {
      data: "Data",
      total: "Total"
   
    },
    pageSize: 10,
    serverPaging: true,
    serverFiltering: true,
    serverSorting: true
  },
  groupable: true,
  filterable: true,
  sortable: true,
  pageable: true,
  columns: [
 { field: "BatchNo", title: "BatchNo" },
 { field: "Fiscal_Year ", title: "Fiscal_Year" },
 { field: "Department", title: "Department" }
  ]
});
});</script>


Grid 2 controller.. I need to get the Batchno value here

ControllerName2.cs

  [HttpPost]
        public ActionResult GetRecords(int take, int skip, IEnumerable<Kendo.DynamicLinq.Sort> sort, Kendo.DynamicLinq.Filter filter)
        {
            //Batchno from grid1 url
           I need the querystring id from grid1 here....          }


Any Help appreiciated. Thank you
Bharathi
Top achievements
Rank 2
 answered on 03 Apr 2014
4 answers
325 views
Ok I'm using globalize.js and registering it BEFORE the kendo culture javascript, and using my helper to pick the right culture file.
In my case it is en-GB.

However, if I bind a DateTime column on my model in a KendoUI grid, it fails to display anything at all.

I have tried various ways as shown here.

columns.Bound(o => o.AuthorityDate);
columns.Bound(o => o.AuthorityDate).Format("{0:d}");
columns.Bound(o => o.AuthorityDate).Title("AuthorityDate").Format("{0:dd/MM/yyyy hh:mm:tt}");

If I switch things and register globalize.js AFTER the kendo javascript, it then binds successfully.

So, I understand that registering globalize.js BEFORE should make kendo use globalize as per the help documentation.

So why is this NOT working?  I am using MVC5.1 kendo build 2014.1.318

<script src="@Url.Content("~/Scripts/globalize/globalize.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/globalize/cultures/globalize.culture." Core.Helpers.CultureHelper.GetCurrentCulture() + ".js")" type="text/javascript"></script>

<
script src="https://da7xgjtj801h2.cloudfront.net/2014.1.318/js/kendo.all.min.js"></script>
<script src="https://da7xgjtj801h2.cloudfront.net/2014.1.318/js/kendo.aspnetmvc.min.js"></script>

<script src="@Url.Content("https://da7xgjtj801h2.cloudfront.net/2014.1.318/js/cultures/kendo.culture." + Core.Helpers.CultureHelper.GetCurrentCulture() + ".min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/kendo.modernizr.custom.js")"></script>
Richard
Top achievements
Rank 1
 answered on 03 Apr 2014
1 answer
136 views
On a partial view, with a model:

@model IEnumerable<HTServices.Models.TableName>
 
​ @foreach (var item in Model)
 {
 @Html.HiddenFor(m => item.TableNameId)
 <div class="row" style="margin-top: 8px;">
 <div class="col-sm-4 col-md-4 col-lg-4">
 @Html.DisplayFor(m => item.TableNameShow)
 </div>
 <div class="col-sm-4 col-md-4 col-lg-4">
 @Html.TextBoxFor(m => item.Note, new { @class = "text-box single-line wide-full" })
 </div>
 <div class="col-sm-2 col-md-2 col-lg-2">
 @(Html.Kendo().DatePickerFor(m => item.ExpirationDt)
 .Start(CalendarView.Month)
 .Min(DateTime.Now.AddMonths(-2))
 .Max(DateTime.Now.AddMonths(12)))
 
 </div>
 <div class="col-sm-1 col-md-1 col-lg-1">
 @Html.ActionLink("Delete", "TableNameDelete", new { id = item.TableNameId }, new { onclick = "return deleteTableNameRecById(this);", @class = "RemoveLinkImage" })
 </div>
 </div>
 }


Here, only the first DatePickerFor control is rendered.

In the HTML, the script block for the DatePicker is added to the HTML, but the entire span wrapper for the Kendo dpf is missing:

here is the first one that is good, and works:

<div class="col-sm-2 col-md-2 col-lg-2">
                <span class="k-widget k-datepicker k-header k-input" style="width: 100%;"><span class="k-picker-wrap k-state-default"><input name="item.ExpirationDt" class="k-input" id="item_ExpirationDt" role="combobox" aria-disabled="false" aria-expanded="false" aria-readonly="false" aria-owns="item_ExpirationDt_dateview" style="width: 100%;" type="text" value="4/1/2014" data-val-required="The Expiration Date field is required." data-val="true" data-val-date="The field Expiration Date must be a date." data-role="datepicker"><span class="k-select" role="button" aria-controls="item_ExpirationDt_dateview" unselectable="on"><span class="k-icon k-i-calendar" unselectable="on">select</span></span></span></span><script>
    jQuery(function(){jQuery("#item_ExpirationDt").kendoDatePicker({"format":"M/d/yyyy","min":new Date(2014,1,1,8,56,43,286),"max":new Date(2015,3,1,8,56,43,286),"start":"month"});});
</script>
 
            </div>

The above only exists for the first item rendered.

All others after the first are only :

<div class="col-sm-2 col-md-2 col-lg-2">
                <input name="item.ExpirationDt" id="item_ExpirationDt" type="date" value="4/1/2014"><script>
    jQuery(function(){jQuery("#item_ExpirationDt").kendoDatePicker({"format":"M/d/yyyy","min":new Date(2014,1,1,8,56,43,286),"max":new Date(2015,3,1,8,56,43,286),"start":"month"});});
</script>
 
            </div>

How do I get all DatePickerFor items rendered in the list?


R


Alexander Popov
Telerik team
 answered on 03 Apr 2014
4 answers
274 views
Hello,

i am facing strange issue with my unit tests and Kendo.Mvc.

My test consist of invoking of controller action which is basically a handler for Grid control:

public virtual ActionResult Get([DataSourceRequest]DataSourceRequest request)
{
    var products = _userService.GetProducts();
    result = products.ToDataSourceResult(request);
 
    return Json(result);
}

The error i am getting from the NUnit console is following:

System.IO.FileNotFoundException : Could not load file or assembly 'System.Web.Mvc, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

All of my projects are targeted against .NET 4.5.1.
Web project is targeting Asp.NET Mvc 5.1 version, which means iam using System.Web.Mvc version 5.1.0.0.
Kendo.Mvc is from the latest release - 2014.1.318.545


To make things even more complicated, when i run the test in isolation (only this one) it passes flawlessly.
But when i try to invoke it using NUnit console it fails throwing the above error.

Any hint is appreciated,
Ljubomir
Ljubomir
Top achievements
Rank 1
 answered on 02 Apr 2014
1 answer
164 views
Currently the MVC helpers will generate an anchor tag with a local href for each tab in the tab strip (e.g. #actions-1, #actions-2), and will generate the subsequent id for each content pane. If the tab strip is the first element on the page, this works ok, but if there is content above the tab strip, then when changing tabs the page will scroll until the tabstrip is at the top of the page, and then scroll back down once the new tab has been loaded. This is a bit jarring and only seems to happen when using Internet Explorer. When using plain html and javascript, local hrefs are not generated. Is there a reason they are generated for the MVC helpers, and are they necessary?
Petur Subev
Telerik team
 answered on 02 Apr 2014
1 answer
147 views
Hi, From one of the example in kendo documentation, when i am trying the same i am unable to bind the data to the scheduler ui, it shows no error but only 500 internal server error. here is my code, I am using mvc 3 razor with EF.

public class Projection : ISchedulerEvent
    {
        public string Title { get; set; }
        public DateTime Start { get; set; }
        public DateTime End { get; set; }
        public string Description { get; set; }
        public bool IsAllDay { get; set; }
        public string Recurrence { get; set; }
        public string RecurrenceRule { get; set; }
        public string RecurrenceException { get; set; }

        public string EndTimezone { get; set; }
        public string StartTimezone { get; set; }
    }

[HttpGet]
        public ActionResult Read()
        {
            List<Projection> cinemaSchedule = new List<Projection> {
                new Projection {
                    Title = "Fast and furious 6",
                    Start = new DateTime(2014,3,31,17,00,00),
                    End= new DateTime(2014,3,31,18,30,00)
                },
                new Projection {
                    Title= "The Internship",
                    Start= new DateTime(2014,3,31,14,00,00),
                    End= new DateTime(2014,3,31,15,30,00)
                },
                new Projection {
                    Title = "The Perks of Being a Wallflower",
                    Start =  new DateTime(2014,3,31,16,00,00),
                    End =  new DateTime(2014,3,31,17,30,00)
                }};
            return Json(cinemaSchedule, JsonRequestBehavior.AllowGet);
        }

@(Html.Kendo().Scheduler<Uco.Models.Projection>()
    .Name("scheduler")
    .Date(new DateTime(2014, 3, 31))
    .StartTime(new DateTime(2014, 3, 31, 7, 00, 00))
    .Height(600)
    .Views(views =>
    {
        views.DayView();
        views.WeekView(weekView => weekView.Selected(true));
        views.MonthView();
    })
    .Timezone("Etc/UTC")
    .BindTo(Model)
)

Can any one help with where i am wrong. I am new to telerik. Thanks in advance




Georgi Krustev
Telerik team
 answered on 02 Apr 2014
1 answer
99 views
Hi i am new to telerik, i am very much confused how to use telerik scheduler controll in my MVC 3 project. I am using Razor for developing my project. Can any one please give any reference of step by step procedure for integrating scheduler in my project.
Thanks in advance..
Atanas Korchev
Telerik team
 answered on 02 Apr 2014
1 answer
172 views
Although the UI for ASP.NET MVC Grid ships with a set EditorTemplates out of the box, there does not appear to be an EditorTemplate for guids.

There are EditorTemplates for integer, number, currency, etc but not for guid.

Any reason why there is not any official Telerik EditorTemplate for guids?

So what's Telerik's recommended best practice?  Create our own EditorTemplate?  Convert back/forth between guids and strings in our ViewModels?
Atanas Korchev
Telerik team
 answered on 02 Apr 2014
3 answers
341 views
Hi,

I am having problems getting the GeoJSON map example working. I have used the same code and there are no errors and the navigation icons on top left are displayed but I can't see any map. The map control works perfectly for Bing so I know that is working.

I assume the issue is related to JSON file I am using. Can I please get a download of the GeoJSON file "~/Content/dataviz/map/countries-users.geo.json" used the example? or a download of the example GeoJSON project.

I am using IE10 latest KendoUI and VS2012.

Thanks

Rob
T. Tsonev
Telerik team
 answered on 01 Apr 2014
10 answers
1.1K+ views
Can the upload control be used in an ajax form within a partial view?  If so can I have an example?  I can make the upload work on a html form but in the ajax form the controller method that is being posted to receives a NULL for the HttpPostedFileBase file parameter.
Stephen
Top achievements
Rank 1
 answered on 01 Apr 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?