Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

getting this error:

The best overloaded method match for 'System.Web.Helpers.WebGrid.WebGrid(System.Collections.Generic.IEnumerable<object>, System.Collections.Generic.IEnumerable<string>, string, int, bool, bool, string, string, string, string, string, string, string)' has some invalid arguments

i am trying this code

C#
public ActionResult Generated_PaySlip(int? emplID, String month) 
        {
            var PaySlip = DataContext.GetMonthlyReport(emplID, month).SingleOrDefault();
            return View(PaySlip);
        }

VIEW:

C#
@using EmployeeAttendance_app.Models

<h2>Employee Pay Slip</h2>

@{

     var grid = new WebGrid(ViewData.Model, rowsPerPage: 20);

 }

 @grid.GetHtml();
Posted
Comments
ZurdoDev 10-Feb-14 7:45am    
It's saying that the constructor for WebGrid is expecting System.Collections.Generic.IEnumerable<object>, System.Collections.Generic.IEnumerable, string, int, bool, bool, string, string, string, string, string, string, string and you only passed in 2.
Hunain Hafeez 10-Feb-14 7:47am    
i know that, how to get it correct ? i am not retrieving collections of records, just one record
ZurdoDev 10-Feb-14 7:50am    
Here's the constructor: http://msdn.microsoft.com/en-us/library/system.web.helpers.webgrid.webgrid%28v=vs.111%29.aspx

You need to pass in all values.
Hunain Hafeez 10-Feb-14 7:53am    
thanks done :)
ZurdoDev 10-Feb-14 7:54am    
No problem. I'll post as solution.

1 solution

 
Share this answer
 
Comments
Hunain Hafeez 10-Feb-14 8:04am    
thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900