This is a migrated thread and some comments may be shown as answers.

Error:"... has some invalid arguments"

1 Answer 441 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Richard asked on 12 Oct 2012, 09:17 PM
Hi, Sorry for the dumb question, but I am VERY new to MVC.  i am trying to lean how to use the Kendo UI Grid to display data from a model.  I am trying to  following the "local data" example but i get the compile error message:
Compiler Error Message: CS1502: The best overloaded method match for 'Kendo.Mvc.UI.Fluent.WidgetFactory.Grid(System.Data.DataTable)' has some invalid arguments

The code is below.  It's pretty basic, doesn't do anything.  I just want to get something to display. I have seen similar questions posted, but I am so new to this stuff that the answers just aren't making sense yet.  Thanks in advance for helping the newbie!

my cshtml looks like this:
@model FactFinder.ClientList.Models.Clients
            
@{
    ViewBag.Title = "Fact Finder";
}
 
<h2>@ViewBag.Message</h2>
 
        Add a new client or select an existing client from the list below. <br />
     
    @Html.Kendo().Grid(Model);    
              
    <input id="NewClient" type="button" value="New Client" />  <input id="EditClient" type="button" value="Edit Client" /> <input id="DeleteClient" type="button" value="Delete Client" /><br />
    @Html.ActionLink("Get Personal Data", "Index", "DataInput")<br />

Model looks like this:
namespace FactFinder.ClientList.Models
{
    public class Clients
    {
        [ScaffoldColumn(false)]
        public int ClientNumber
        {
            get;
            set;
        }
 
        [Required]
        [DisplayName("Client Name")]
        public string ClientName { get; set; }
 
        [DisplayName("Spouse Name")]
        public string SpouseName { get; set; }
 
         
    }
}

1 Answer, 1 is accepted

Sort by
0
Marty
Top achievements
Rank 1
answered on 18 Dec 2012, 09:22 PM
Hi, I ran into that a couple times moving to partial views... Make sure you are passing a "collection" as your model..
Maybe @model IEnumerable<FactFinder.ClientList.Models.Clients>
Marty
Tags
Grid
Asked by
Richard
Top achievements
Rank 1
Answers by
Marty
Top achievements
Rank 1
Share this question
or