Telerik Forums
UI for ASP.NET MVC Forum
0 answers
211 views
i don't know how to set it.
charn
Top achievements
Rank 1
 asked on 17 Jun 2012
0 answers
316 views
I can't get this up and running, get the compilation error:
 
'Kendo.Mvc.UI.Fluent.AjaxDataSourceBuilder<Core.Country>' does not contain a definition for 'Data' and no extension method 'Data' accepting a first argument of type 'Kendo.Mvc.UI.Fluent.AjaxDataSourceBuilder<Core.Country>' could be found (are you missing a using directive or an assembly reference?)

I'm using :

@using Kendo.Mvc.UI
@
using Kendo.Mvc.Extensions

 

 
@model Core.Country[]

Can someone tell me, am I  missing a using directive or an assembly reference?

Many thanks in advance.



Sorted: The extension method 'Data' is on .Read(...) not the datasource as the documentation on Ajax Binding: "Pass Additional Data to Action Method" would have you believe.

K.

Kevin
Top achievements
Rank 1
 asked on 15 Jun 2012
1 answer
202 views
I have a page with both the kendo mvc grid and chart. If i add both
<script src="@Url.Content("~/Scripts/kendo.aspnetmvc.min.js")"></script>
<script src="@Url.Content("~/Scripts/kendo.dataviz.min.js")"></script>
, chart does not work. if i remove aspnet.min.js reference, it works fine.
This is what my Layout.cshtml looks like
<!DOCTYPE html>
<
html>
<
head>
   <title>@ViewBag.Title</title>
   <
link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />   
   <
link rel="stylesheet" href="@Url.Content("~/Content/kendo.common.min.css")">
   <
link href="@Url.Content("~/Content/kendo.dataviz.min.css")" rel="stylesheet" type="text/css" />
   <
link rel="stylesheet" href="@Url.Content("~/Content/kendo.default.min.css")">
   <
script src="@Url.Content("~/Scripts/jquery.min.js")"></script><br>
   <
script src="@Url.Content("~/Scripts/kendo.web.min.js")"></script>
   @*<
script src="@Url.Content("~/Scripts/kendo.aspnetmvc.min.js")"></script>*@
   <
script src="@Url.Content("~/Scripts/kendo.dataviz.min.js")"></script>
  <
script src="@Url.Content("~/Scripts/jquery-ui-1.8.11.min.js")" type="text/javascript"></script>
</head>
<body>
  @RenderBody()

</
body>
</
html>

For my project, it is a big problem, if i cannot add them together. Please inform me if putting them together is the issue or if i am doing something wrong
Atanas Korchev
Telerik team
 answered on 15 Jun 2012
6 answers
1.0K+ views
Hello there,

I have a quick question on how the grid picks up the validation attribute we have on the model.  My grid has batch editing enabled and there's a column bound to the "Name" property of my model.  The Name property is decorated with the [Required] attribute and the required field validator works out of the box, which is nice.  However if I replace [Required] with [RequiredCustom] (where RequiredCustomAttribute is my own class that extends RequiredAttribute), the grid will ignore it and the required field validation will not kick in.  The reason for having the RequiredCustomAttribute is so I can have a logic to build up the validation message from the database.  Back in the old days of Telerik ASP.NET MVC, the grid didn't have any issue picking up my [RequiredCustom].  Has there been a change in this area for Kendo UI for MVC?

Thanks,

Ben
ben
Top achievements
Rank 1
 answered on 14 Jun 2012
1 answer
746 views
Hi I am  using Kendo.MVC.dll:
In MS Sql (2012) table I have column:

    Day Data Type datetime

In the controller I get the data using"
 

      public ActionResult BloodPressure_Read([DataSourceRequest] DataSourceRequest request)
            {
             return Json(BPRepository.All().ToDataSourceResult(request));
            }

In the view:

    @(Html.Kendo().Grid<BPViewModel>()
    
        .Name("Grid")
        .Columns(columns =>
        columns.Bound(p => p.Day).Format("{0:d}");

The date is displayed as 1/1/2012; however when I edit it (using Ajax) it shows as Sun Jan 1 00:00:00 PST 2012!!  When I try to update the row, I get "Day is invalid Date.

Any idea how I can convert the date to yyyy,mm, dd?
Thanks in advance.
Daniel
Telerik team
 answered on 14 Jun 2012
0 answers
258 views
I have index.cshtml as follows:

@model IEnumerable<Dadavani.Models.Dad_Repost_Transaction>
@{
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@{
    ViewBag.Title = "Repost";
}
<script src="../../Scripts/Kendo/jquery.min.js" type="text/javascript"></script>
<script src="../../Scripts/Kendo/kendo.web.min.js" type="text/javascript"></script>
<script src="../../Scripts/Kendo/kendo.aspnetmvc.min.js" type="text/javascript"></script>
<script src="../../Scripts/Kendo/console.js" type="text/javascript"></script>
 
 
 
 
<link href="../../Content/Kendo/kendo.common.min.css" rel="stylesheet" type="text/css" />
<link href="../../Content/Kendo/kendo.default.min.css" rel="stylesheet" type="text/css" />
 
 
<h2>Repost</h2>
@(Html.Kendo().Grid(Model)   
    .Name("Grid")
    .Columns(columns =>
    {
        columns.Bound(model => model.SR_NO);
        columns.Bound(model => model.MEMBER_ID);
        columns.Bound(model => model.R_MONTH);
        columns.Bound(model => model.PRINT_YN);
        columns.Command(command => { command.Edit(); command.Destroy(); }).Width(200);
    })
    .ToolBar(toolbar =>
    {
        toolbar.Create();
    })
    .Editable(editable => editable.Mode(GridEditMode.InLine))
    .Groupable()
    .Pageable()
    .Sortable()
    .Scrollable()
    .Filterable()            
    .DataSource(dataSource => dataSource
        .Ajax()
            .Model(p => p.Id(model => model.SR_NO))
            .Create(update => update.Action("Create", "Repost"))
            //.Read(read => read.Action("GetReposts", "Repost"))
            .Read(read => read.Action("Read", "Repost"))
            .Update(update => update.Action("Update", "Repost"))
            .Destroy(update => update.Action("Destroy", "Repost"))
    )
    
)
<div id="Grid"></div>

read works fine showing all records. When I click 'Add New Record', it shows error as follows.

This request has been blocked because sensitive information could be disclosed to third party web sites when this is used in a GET request. To allow GET requests, set JsonRequestBehavior to AllowGet

the method I created is as follows which is similar to UI Kendo MVC examples. So, what is the problem?

[AcceptVerbs(HttpVerbs.Post)]
        public ActionResult Create([DataSourceRequest] DataSourceRequest request, Dad_Repost_Transaction repost)
        {
 
            if (repost != null && ModelState.IsValid)
            {
                    context.Reposts.Add(repost);
                    context.SaveChanges();
            }
 
            return Json(new [] { repost }.ToDataSourceResult(request, ModelState),JsonRequestBehavior.AllowGet);
           
        }
Hetal
Top achievements
Rank 1
 asked on 14 Jun 2012
2 answers
75 views
Hi there,

I'm not sure if this is a known issue.  For a command column and a bound column with Filterable(false), the filter icon on top on the column still shows.  I suppose this has something to do with the MVC wrapper as it was working fine earlier on the regular Kendo UI.  Please let me know if you need more info on reproducing the bug.

Thanks,

Ben
ben
Top achievements
Rank 1
 answered on 13 Jun 2012
5 answers
225 views
Hi.
I have been testing MVC Kendo.

Testing Grid has an unexpected behavior (see attached image grid_twice.png).

That render is result of the following code:
view:
@model IEnumerable<_2TrackControl.MVC4.Models._2TrackControl.KitViewModel>
@using Kendo.Mvc.UI
@{
    ViewBag.Title = "Index";
}
<h2>
    Index</h2>
<p>
    @Html.ActionLink("Create New", "Create")
</p>
@(Html.Kendo().Grid(Model)   
    .Name("Grid")
    .Columns(columns =>
    {
        columns.Bound(p => p.ClientSetName).Groupable(false);
        columns.Bound(p => p.IMEI);
        columns.Bound(p => p.Active);
        columns.Bound(p => p.Inserted);
    })
    .Groupable()
    .Pageable()
    .Sortable()
    .Scrollable()
    .Filterable()            
    .DataSource(dataSource => dataSource
         
        .Ajax()
        .Read(read => read.Action("_Index", "Kit"))       
    )
)
and actions:

private Entities db = new Entities();
  
//
// GET: /Kit/
  
public ActionResult Index()
{
    var kitset = db.KitSet.Include("ClientSet");
  
    Mapper.CreateMap<KitSet, KitViewModel>();
    var resultReturn = Mapper.Map<List<KitSet>, List<KitViewModel>>(kitset.ToList());
  
    return View(resultReturn);
}
  
public ActionResult _Index([DataSourceRequest] DataSourceRequest request)
{
    var kitset = db.KitSet.Include("ClientSet");
  
    Mapper.CreateMap<KitSet, KitViewModel>();
    var resultReturn = Mapper.Map<List<KitSet>, List<KitViewModel>>(kitset.ToList());
    return Json(resultReturn.ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
}

Can you figure what is happening?
Thanks
figueiredorj
Top achievements
Rank 1
 answered on 13 Jun 2012
3 answers
204 views
I have an integer column with filtering enabled. While equal to, less than, and greater than filter works, less than or equal to and greater than or equal to filtering throws this exception:

[NullReferenceException: Object reference not set to an instance of an object.]
Kendo.Mvc.Infrastructure.Implementation.FilterNodeVisitor.Visit(PropertyNode propertyNode) +42
Kendo.Mvc.Infrastructure.Implementation.PropertyNode.Accept(IFilterNodeVisitor visitor) +10
Kendo.Mvc.Infrastructure.FilterDescriptorFactory.Create(String input) +128
Kendo.Mvc.UI.DataSourceRequestModelBinder.BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext) +213
System.Web.Mvc.ControllerActionInvoker.GetParameterValue(ControllerContext controllerContext, ParameterDescriptor parameterDescriptor) +317
System.Web.Mvc.ControllerActionInvoker.GetParameterValues(ControllerContext controllerContext, ActionDescriptor actionDescriptor) +117
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +324
System.Web.Mvc.Controller.ExecuteCore() +106
System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +91
System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +10
System.Web.Mvc.&lt;&gt;c__DisplayClassb.&lt;BeginProcessRequest&gt;b__5() +34
System.Web.Mvc.Async.&lt;&gt;c__DisplayClass1.&lt;MakeVoidDelegate&gt;b__0() +19
System.Web.Mvc.Async.&lt;&gt;c__DisplayClass8`1.&lt;BeginSynchronous&gt;b__7(IAsyncResult _) +10
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
System.Web.Mvc.&lt;&gt;c__DisplayClasse.&lt;EndProcessRequest&gt;b__d() +48
System.Web.Mvc.SecurityUtil.&lt;GetCallInAppTrustThunk&gt;b__0(Action f) +7
System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +22
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +60
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9615056
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +155
Iliana Dyankova
Telerik team
 answered on 12 Jun 2012
1 answer
231 views
Title says it all, I have a fairly simple POCO mapped to a database using nHibernate and I'm using server binding to build my grid. I am auto generating my columns in the grid but properties on my POCO that are decorated with [ScaffoldColumn(false)] are still being shown in my grid. However I will note that they are correctly being ignored on the popups generated from making the grid editable.
Html.Kendo().Grid(Model)
    .Name("Grid")
        .Columns(columns =>
            {
                columns.AutoGenerate(true);
                columns.Command(command =>
                    {
                        command.Edit();
                    });
            })
    .ToolBar(toolbar => toolbar.Create())
    .Editable(editable => editable.Mode(GridEditMode.PopUp))

Iliana Dyankova
Telerik team
 answered on 12 Jun 2012
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
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
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?