Telerik Forums
Kendo UI for jQuery Forum
0 answers
227 views
Hi

 We are getting the error  "No parameterless constructor defined for this object" when we try to bind collection to the Kendo grid and obviously the business objects that we have in our business layer has private constructors and it worked fine with Telerik. 

Here is the stack trace of the error 

Line 171:    {
Line 172:        //@(Html.Kendo().Grid<City.Australia.Framework.BL.UserInfo>()
Line 173:        @(Html.Kendo().Grid(Model.Users)
Line 174:            .Name("UserGrid")
Line 175:            .EnableCustomBinding(true)


Source File: d:\Development\City.Australia.Admin\City.Australia.Admin\Views\User\Search.cshtml    Line: 173 

Stack Trace: 

[MissingMethodException: No parameterless constructor defined for this object.]
   System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0
   System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache) +98
   System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache) +241
   System.Activator.CreateInstance(Type type, Boolean nonPublic) +69
   Kendo.Mvc.UI.ModelDescriptor.CreateDataItem(Type modelType) +131
   Kendo.Mvc.UI.ModelDescriptor..ctor(Type modelType) +40
   Kendo.Mvc.UI.DataSource.ModelType(Type modelType) +31
   Kendo.Mvc.UI.Grid`1..ctor(ViewContext viewContext, IJavaScriptInitializer initializer, IUrlGenerator urlGenerator, IGridHtmlBuilderFactory htmlBuilderFactory) +822
   Kendo.Mvc.UI.Fluent.WidgetFactory.Grid() +114
   Kendo.Mvc.UI.Fluent.WidgetFactory.Grid(IEnumerable`1 dataSource) +55
   ASP._Page_Views_User_Search_cshtml.Execute() in d:\Development\City.Australia.Admin\City.Australia.Admin\Views\User\Search.cshtml:173
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +207
   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +81
   System.Web.WebPages.StartPage.RunPage() +19
   System.Web.WebPages.StartPage.ExecutePageHierarchy() +65
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +76
   System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) +220
   System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) +115
   System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +303
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) +13
   System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +23
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +260
   System.Web.Mvc.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +177
   System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +343
   System.Web.Mvc.Controller.ExecuteCore() +116
   System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +97
   System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +10
   System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +37
   System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +21
   System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +12
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
   System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +50
   System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>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() +8969117
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184

Thanks
Rasika Perera
Rasika
Top achievements
Rank 1
 asked on 18 Jul 2012
0 answers
154 views
I am trying to use the buttongroup to switch between two views that contain charts on mobile device. However, my code is not working. All that is rendered are the two buttons and the nav bar at the top. The charts are not showing up. I tried the code for drawing the charts in stand alone views and that worked fine. I am attaching my code snippets. Please let me know what is the best approach for this.

Thanks,
Anu
Anu
Top achievements
Rank 1
 asked on 18 Jul 2012
0 answers
91 views
z
 
Ryan
Top achievements
Rank 1
 asked on 17 Jul 2012
0 answers
135 views
I do this now using the detailinit technique with the grid - but wondering how I might use this method to achieve something similar.
Kenneth
Top achievements
Rank 1
 asked on 17 Jul 2012
2 answers
563 views
I am just starting with Kendo UI.  I have a .NET MVC Razor project that will include a Kendo Grid.  My page loads fine and looks good-the data is in the grid, but I have two issues:
(1) when I click the "filter" icon, nothing happens (no pop-up, nothing)
(2) when I run the page I get an error in visual studio inside the kendo.all.min.js file (Error: Microsoft JScript runtime error: Object doesn't suport this action.  Code highlighted reads "d.transport=new n.data.transports[a.type](c(h,{data:i}))"  Running in firebug gives this error: "n.data.transports[a.type] is not a constructor"

I am using a Model that is of type List<CustomViewModel>.  I have added the following scripts and css to my _Layout partial view:
    <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/kendo.common.min.css")" rel="stylesheet" type="text/css" />  
    <link href="@Url.Content("~/Content/kendo.default.min.css")" rel="Stylesheet" type="text/css" />

    <script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/modernizr-1.7.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/kendo.all.min.js")" type="text/javascript"></script>

(I tried using "kendo.web.min" and "kendo.aspnetmvc.min" in the place of "kendo.all.min" and I get the same result, but the error is in kendo.web.min.js)


My page looks like this:

@model List<CustomViewModel>
...
@(Html.Kendo().Grid(Model)
    .Name("applicantGrid")
    .Columns(columns =>
        {
            columns.Bound(p => p.ApplicationID);
            columns.Bound(p => p.FirstName);
            columns.Bound(p => p.LastName);            
        })
    .Sortable()
    .Filterable()  
    .Pageable()        
)


My View Model looks like this:

    public class CustomViewModel
    {
        [ScaffoldColumn(false)]
        public Guid CustomViewModelID { get; set; }

        [Display(Name = "First Name")]
        public string FirstName { get; set; }

        [Display(Name = "Last Name")]
        public string LastName { get; set; }
    }
Dennis
Top achievements
Rank 1
 answered on 17 Jul 2012
1 answer
156 views

Hi,

How do I format the datepicker control to always display the date in the format dd/mm/yyyy.

Thanks
Alexander Valchev
Telerik team
 answered on 17 Jul 2012
1 answer
552 views

Hi,

If a grid has no records I do not want to display the grid at all (including the headers) but would like to display a text message instead. Is this possible using Kendo?

Thanks
Alexander Valchev
Telerik team
 answered on 17 Jul 2012
1 answer
139 views
I am creating an application that needs to have multiple "image buttons" that fills the screen and looks like the Andriod Grid List.  When the user clicks the image, it goes to another page. What is the best approach to creating this functionality using Kendo controls?

Thanks!

Alexander Valchev
Telerik team
 answered on 17 Jul 2012
4 answers
194 views
I upgraded to 710, and I see some changes to the page turners, but I have not figured out how the USER is able to do these new features:

  • Implement "Refresh" button in the pager
  • Allow the user to change the page size of the grid
  • Ability to change the current page by typing it in a textbox

I also an very intrigued by this feature, can you explain what it is (I am already adding double click to the rows by:

  • Ability to attach click handler to custom commands

$('#gridWidget tbody > tr[data-uid]').dblclick(DisplayItemDetails);

Finally, I was given this code by Telerik for collapsing all the groups and expanding them. It stopped working in 2.710, I can fix it, but is there a way that will be a safe fix for future versions?

function collapseAll() {
    $("#gridWidget").find(".k-icon.k-collapse").trigger("click");
}
 
function expandAll() {
    $("#gridWidget").find(".k-icon.k-expand").trigger("click");
}
Dr.YSG
Top achievements
Rank 2
 answered on 17 Jul 2012
1 answer
304 views
Hi, i'm new to this forums, and i'm testing your fantastic jquery library.
i've looking for a solution in the forums, but no one found.
I'm using prestashop webservices and i have this code:(modified from one sample)

<!DOCTYPE html>
<html>
<head>
    <title>Binding to remote data</title>
    <link href="../../content/shared/styles/examples-offline.css" rel="stylesheet">
    <link href="../../../styles/kendo.common.min.css" rel="stylesheet">
    <link href="../../../styles/kendo.default.min.css" rel="stylesheet">
    <script src="../../../js/jquery.min.js"></script>
    <script src="../../../js/kendo.web.min.js"></script>
    <script src="../../content/shared/js/console.js"></script>
</head>
<body>
    <a class="offline-button" href="../index.html">Back</a>
        <div id="example" class="k-content">
            <div id="grid"></div>
            <script type="text/javascript">
                $(document).ready(function() {
                    $("#grid").kendoGrid({
                        dataSource:  new kendo.data.DataSource({
                            transport: {
                                // specify the XML file to read. The same as read: { url: "books.xml" }
                                read: "http://mykey@localhost/orion/api/customers/1"
                            },
                            schema: {
                                // specify the the schema is XML
                                type: "xml",
                                // the XML element which represents a single data record
                                data: "/prestashop/customer",
                                // define the model - the object which will represent a single data record
                                model: {
                                    // configure the fields of the object
                                    fields: {
                                        // the "title" field is mapped to the text of the "title" XML element
                                        elid: "id/text()",
                                        // the "author" field is mapped to the text of the "author" XML element
                                        nombre: "firstname/text()",
                                        // the "url" field is mapped to the text of the "url" XML element
                                        apellidos: "lastname/text()",
                                        
                                    }
                                }
                            }
                        }),
                        scrollable: false,
                        sortable: true
                    });
                });
            </script>
        </div>
</body>
</html>

and does not work, the screen is blank, but if i change:
read: "http://mykey@localhost/orion/api/customers/1"
with:
read: "1.xml"
that contains de content of "http://mykey@localhost/orion/api/customers/1", that's:
<prestashop>
    <customer>
        <id>1</id>
        <id_default_group xlink:href="http://localhost/orion/api/groups/1">1</id_default_group>
        <newsletter_date_add/>
        <ip_registration_newsletter/>
        <last_passwd_gen readonly="true">2012-06-09 09:05:45</last_passwd_gen>
        <secure_key readonly="true">47ce86627c1f3c792a80773c5d2deaf8</secure_key>
        <deleted>0</deleted>
        <passwd>6f9c2e625d0cc6fe573231821c23859b</passwd>
        <lastname>DOE</lastname>
        <firstname>John</firstname>
        <email>pub@prestashop.com</email>
        <note/>
        <id_gender>1</id_gender>
        <birthday>1970-01-15</birthday>
        <newsletter>1</newsletter>
        <optin>1</optin>
        <active>1</active>
        <is_guest>0</is_guest>
        <date_add readonly="true">2012-06-09 02:05:45</date_add>
        <date_upd readonly="true">2012-06-09 02:05:45</date_upd>
        <associations>
            <groups node_type="group">
                <group xlink:href="http://localhost/orion/api/groups/1">
                    <id>1</id>
                </group>
            </groups>
        </associations>
    </customer>
</prestashop>
it shows one row in the grid.

What can be wrong?. the server is on and the requested page is served in form of xml, but i don't know how to make it work. help me.

Thanks
Thomas
Top achievements
Rank 1
 answered on 17 Jul 2012
Narrow your results
Selected tags
Tags
Grid
General Discussions
Charts
Data Source
Scheduler
DropDownList
TreeView
MVVM
Editor
Window
DatePicker
Spreadsheet
Upload
ListView (Mobile)
ComboBox
TabStrip
MultiSelect
AutoComplete
ListView
Menu
Templates
Gantt
Validation
TreeList
Diagram
NumericTextBox
Splitter
PanelBar
Drag and Drop
Application
Map
ToolTip
Calendar
PivotGrid
ScrollView (Mobile)
Toolbar
TabStrip (Mobile)
Slider
Button (Mobile)
Filter
SPA
Drawing API
Drawer (Mobile)
Globalization
LinearGauge
Sortable
ModalView
Hierarchical Data Source
Button
FileManager
MaskedTextBox
View
Form
NavBar
Notification
Switch (Mobile)
SplitView
ListBox
DropDownTree
PDFViewer
Sparkline
ActionSheet
TileLayout
PopOver (Mobile)
TreeMap
ButtonGroup
ColorPicker
Pager
Styling
Chat
MultiColumnComboBox
Dialog
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
PivotGridV2
Licensing
ScrollView
Switch
TextArea
BulletChart
QRCode
ResponsivePanel
Wizard
CheckBoxGroup
Localization
Barcode
Breadcrumb
Collapsible
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
TimePicker
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
BottomNavigation
Ripple
SkeletonContainer
Avatar
Circular ProgressBar
FlatColorPicker
SplitButton
Signature
Chip
ChipList
VS Code Extension
AIPrompt
PropertyGrid
Sankey
Chart Wizard
OTP Input
SpeechToTextButton
InlineAIPrompt
StockChart
ContextMenu
DateTimePicker
RadialGauge
ArcGauge
AICodingAssistant
SmartPasteButton
PromptBox
SegmentedControl
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
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?