Telerik Forums
UI for ASP.NET MVC Forum
1 answer
133 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
301 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
223 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
111 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
946 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
311 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
115 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
256 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
151 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
137 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
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
Rating
ScrollView
ButtonGroup
CheckBoxGroup
Licensing
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
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?