Telerik Forums
UI for ASP.NET MVC Forum
4 answers
315 views

I am working an application using Kendo Grid on an MVC application.  Starting at about 10:30 (central time) yesterday, the kendo grid software stopped working.  I am using IE 10 on a Windows 7 OS. The error is

Unhandled exception at line 3, column 23238 in http://cdn.kendostatic.com/2014.1.318/js/jquery.min.js
0x80020003 - JavaScript runtime error: Member not found.

I am able to replicate the error in a simple application.  The View file contains the following definition for the grid

 

@(Html.Kendo().Grid<MvcApplication1.Models.TestItem>()
  .Name( "testItemGrid" )
  .Columns( columns =>
  {
    columns.Command( command =>
    {
      command.Edit();
    } ).Width( 195 );
    columns.Bound( x => x.ItemId );
    columns.Bound( x => x.Name );
  } )
  .ToolBar( toolbar =>
  {
    toolbar.Create().Text( "Add New Item" );
  } )
  .Sortable()
  .Editable( editable => editable.Mode( GridEditMode.InLine ) )
  .DataSource( ds => ds
    .Ajax()
    .Model( m =>
            {
              m.Id( x => x.ItemId );
            } )
     .Read( "TestItemRead", "TestItemGrid" )
     .Create( "TestItemCreate", "TestItemGrid" )
     .Update( "TestItemUpdate", "TestItemGrid" )
    )
  )

 

The controller contains the following actions:
 

public class TestItemGridController : Controller
{
  public ActionResult Index()
  {
    return View();
  }
 
  public ActionResult TestItemRead( [DataSourceRequest] DataSourceRequest request )
  {
    List<Models.TestItem> items = new List<Models.TestItem>();
    items.Add( new Models.TestItem() { ItemId = 1, Name = "Item 1" } );
    items.Add( new Models.TestItem() { ItemId = 2, Name = "Item 2" } );
    items.Add( new Models.TestItem() { ItemId = 3, Name = "Item 3" } );
    items.Add( new Models.TestItem() { ItemId = 4, Name = "Item 4" } );
    items.Add( new Models.TestItem() { ItemId = 5, Name = "Item 5" } );
    return Json( items.ToDataSourceResult( request ) );
  }
 
  public ActionResult TestItemCreate( [DataSourceRequest] DataSourceRequest request, Models.TestItem testItem )
  {
    if( testItem != null && ModelState.IsValid )
    {
    }
    return Json( new[] { testItem }.ToDataSourceResult( request, ModelState ) );
  }
 
  public ActionResult TestItemUpdate( [DataSourceRequest] DataSourceRequest request, Models.TestItem testItem )
  {
    if( testItem != null && ModelState.IsValid )
    {
    }
    return Json( ModelState.ToDataSourceResult() );
  }
}

 

I have tried several things to fix the error:
1. Update to latest version of Telerik software
 2. Use CDN support
 3. Use Local support

 I am at my wits end to resolve this issue.  Please help!

Leon
Top achievements
Rank 1
 answered on 07 Apr 2014
7 answers
429 views
Successfully using the HTML Editor, I would like to give my users the ability to resize the editor window (like shown in the attachment scribble).



My question:

Is it possible to turn on this functionality or simulate it in some way (maybe something with splitter?)
Dimo
Telerik team
 answered on 07 Apr 2014
2 answers
210 views
I'm using Kendo UI Grid to populate list of data and when i click on particular row i need to redirect to another view page of that particular row. but i have a delete command for that particular row. When i try to delete particular row it redirect to another page.i don't need any redirection after deletion. so the possible solution is i want to deselect only the command column when i select a particular row. Both i need row selection but no need command column selection..Please give a solution  for this...

  @(Html.Kendo().Grid<Portal.Presentation.Web.BoundedContext.TNA.Template.MVC.Areas.Razor.Models.TemplateModel>()
                  .Name("grid_Template_Freeze")
                  .AutoBind(true)
                  .Groupable()
                  .Sortable()
                  .HtmlAttributes(new { style = "border: 0;" })
                  .Scrollable(a => a.Height("auto"))
                          .Selectable(sel => { sel.Mode(GridSelectionMode.Single); sel.Type(GridSelectionType.Row); sel.Enabled(true);
                          })
                  .Columns(c =>
                               {
                                   c.Bound(p => p.TemplateId).Hidden();
                                   c.Bound(p => p.TemplateName).Title("&nbsp;").Title("TEMPLATE NAME");
                                   c.ForeignKey(p => p.ProductTypeId, (System.Collections.IEnumerable) ViewData["ProductTypes"], "Key", "Value").Title("PRODUCT TYPE");
                                   c.ForeignKey(p => p.OwnershipId, (System.Collections.IEnumerable)ViewData["UserTypes"], "Key", "Value").Title("OWNERSHIP");
                                   c.Bound(p => p.CreatedOn).Title("CREATED DATE").Format("{0:dd/MM/yyyy hh:mm}");
                                   c.Bound(p => p.UpdatedOn).Title("LAST MODIFIED DATE").Format("{0:dd/MM/yyyy hh:mm}");
                                   c.ForeignKey(p => p.StatusId, (System.Collections.IEnumerable)ViewData["StatusTypes"], "Key", "Value").Title("STATUS");
                                   c.Command(command => command.Destroy()).Width(80);

                               })
                  .Events(evt => evt.Change("TemplateTaskHandler.onChange"))
                  .DataSource(dataSource => dataSource
                                                .Ajax()
                                                .Sort(sort => sort.Add(p => p.TemplateName).Descending())
                                                .Model(model =>
                                                               {
                                                                   model.Id(p => p.TemplateId);
                                                                   model.Field(p => p.TemplateId);
                                                               })
                                                .Events(events => events.Error("error_handler"))
                                                .PageSize(20).ServerOperation(false)
                                                .Destroy(destroy => destroy.Action("OnTempaleDelete", "List"))
                                                .Read(read => read.Action("OnTempaleRead", "List"))
                  ).Pageable(x => { x.Enabled(true); x.PreviousNext(true); x.PageSizes(true); x.Info(true); x.Input(true); x.Numeric(false); x.Refresh(true); }))



 var TemplateTaskHandler = {

        onChange: function (e) {

            var grid = $("#grid_Template_Freeze").data("kendoGrid");
            var item = grid.dataSource.data()[grid.select().index()];
            location.href = "@Model.ResolveRouteUrl(Portal.Presentation.Web.BoundedContext.TNA.Template.MVC.Areas.Razor.Models.TnaModelTypes.Update)" + "&tmpl=" + item.TemplateId;
        }
    };
}
administrator
Top achievements
Rank 1
 answered on 07 Apr 2014
1 answer
158 views
I'm work on asp.net mvc application, I used kendo UI controls in my application
I added many controls from kendo UI tools ,it worked correctly
when I tried to add Html.Kendo().ComboBox() tool it displayed in browser like text field not combo box and it didn't displayed any item of the control
I wrote the following example

@(Html.Kendo().ComboBox().Name("kcombobox").Placeholder("Select a value...") .BindTo(new string[] {"Bulgaria", "United States", "India","Australia", "United Kingdom"}  ) )

so where is the problem please
Dimo
Telerik team
 answered on 04 Apr 2014
3 answers
323 views
I am using the UI for ASP.NET MVC controls in my application and I need to be able to create PDFs of a view that dynamically loads data.  Is this possible and if so how would I go about doing it?
Stef
Telerik team
 answered on 04 Apr 2014
3 answers
239 views
Hi Guys,

First of all, here's my grid definition

@(Html.Kendo().Grid<DATACLASS_ATTRIBUTES_T012>()
            .Name("Grid")
            .ToolBar(commands => { commands.Create().Text("New Attribute"); })
            .Columns(columns =>
            {
                columns.ForeignKey("ATTRIBUTEID", ViewBag.Attributes).ClientTemplate("#: data.DC_ATTRIBUTES_T006 ? DC_ATTRIBUTES_T006.NAME : 'none'#").Width(270);
                columns.Command(command => { command.Edit().UpdateText("Save"); }).Width(173);
                 
            })
            .Pageable()
            .Sortable()
            .Scrollable()
            .Filterable()
            .Editable(mode => mode.Mode(GridEditMode.InLine))
            .DataSource(dataSource => dataSource
                .Ajax()
                .PageSize(5)
                .ServerOperation(false)
                .Model(model =>
                {
                    model.Id(v => v.ID);
                    model.Field(v => v.ATTRIBUTEID).DefaultValue(1);
                    model.Field(v => v.UOM_ID).DefaultValue(null);
                    model.Field(v => v.DATACLASS_ID).DefaultValue(Model.ID);
                })
                .Read(r => r.Action("GetAttributeByDataClass/" + Model.ID, "Attribute"))
                .Update(r => r.Action("UpdateDataClassAttribute", "Attribute"))
                .Create(r => r.Action("CreateDataClassAttribute", "Attribute"))
             )
        )

My validation issue is that, on create, if I try to save without selecting a value for UOM_ID, I get the "The field Measure Unit must be a number." error.
Here is the data annotation related to this field

[UIHint("MeasureUnitEditor")]
[Display(Name = "Measure Unit")]
public Nullable<int> UOM_ID;

How come that validation doesn't succeed when the dafault value for that field is null (as defined inside grid's model) and the model's field is Nullable??

My Goal here is to build a custom creation process...I'd like to set the measure unit only if the value choosen from the first field (attributeID - rendered as a combo) is of a certain type...
Is it possible?

Thanks
Fabio
Petur Subev
Telerik team
 answered on 04 Apr 2014
3 answers
138 views
Can we use the mobile mvc tabstrip with web?
I cant seem to get any css on my tabstrip

Also when initializing tabstript this messes up bootstrap menu, menu now covers page content.
Where am I going wrong,
Thanks


   
         @code
 Dim mobileTab As Kendo.Mvc.UI.MobileTabStrip = Html.Kendo.MobileTabStrip().Name("mobileTab").Items(Sub(items)
items.Add().Icon("contacts").Text("Products")
items.Add().Icon("cart").Text("Shopping Cart")
 End Sub) _
 .Events(Function(events) events.Select("onSelect"))
 
 
mobileTab.Render()
 End Code
         
      
        @Html.Kendo().MobileApplication().ServerNavigation(true)
Kiril Nikolov
Telerik team
 answered on 04 Apr 2014
5 answers
984 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
328 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
140 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
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
ColorPicker
DateRangePicker
Security
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
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
SmartPasteButton
PromptBox
SegmentedControl
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?