Click here to Skip to main content
15,911,848 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
So I have a method in my busniess logic that I am assigning defaults to and creating a List:
var ppc1Result = POCMethods.GetPPCRatesAndStatusesInRowsOverallMedSurg(PPCRatesAndStatusesInRowsOverallMedSurgDTO.Default()).ToList();


When I debug the data I want is there in the variable 'ppc1Result', but how do I use this list in a WebGrid. When I write out the column names from the list, I am getting an error saying the column name doesn't exist, here's my WebGrid:

@{
    var grid = new WebGrid(ppc1Result, canPage: true, rowsPerPage: 5,
    selectionFieldName: "selectedRow", ajaxUpdateContainerId: "measuresMain");
    grid.Pager(WebGridPagerModes.NextPrevious);
}

<div id="measuresMain">
    @grid.GetHtml(
        tableStyle: "webGrid",
        headerStyle: "header",
        alternatingRowStyle: "alt",
        selectedRowStyle: "select",
        columns: grid.Columns(
                grid.Column("DischargeswAtRisk", "DischargesAtRisk"),
                grid.Column("DischargesWithPPC", "DischargesWithPPC"),
                grid.Column("DRGType", "DRGType"),
                grid.Column("NormativeRate", "NormativeRate"),
                grid.Column("OverallDischargeCounts", "OverallDischargeCounts"),
                grid.Column("SumWeight", "SumWeight"),
                grid.Column("TotalImpact", "TotalImpact")
    ))
</div>


This results in an error.
Posted
Updated 17-Sep-13 4:54am
v3
Comments
Sergey Alexandrovich Kryukov 17-Sep-13 10:52am    
C# is case-sensitive, it cannot accept anything named "ToLIst". :-)
—SA
JasonMacD 17-Sep-13 10:55am    
var ppc1Result = POCMethods.GetPPCRatesAndStatusesInRowsOverallMedSurg(PPCRatesAndStatusesInRowsOverallMedSurgDTO.Default()).ToList();


I may have put ToLIst in the title, but I'm not sure you looked at the code. I update the title to avoid more critiques. Any help on the question though?

1 solution

I solved this, I had a misspelled column.
 
Share this answer
 

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