none
convert column to row in webgrid in mvc4 razor RRS feed

  • Question

  • i need output like this

    students    totalpoints    newassignemnt    testing   assignment

    raj kumar      30/55          10/20               10/15       10/20 


    but it displays like this


    students    totalpoints    newassignemnt  students    totalpoints    testing students    totalpoints    assignment

    raj kumar      30/55          10/20             raj kumar      30/55           10/15   raj kumar      30/55     10/20 
    raj kumar      30/55          10/20             raj kumar      30/55           10/15   raj kumar      30/55     10/20 
    raj kumar      30/55          10/20             raj kumar      30/55           10/15   raj kumar      30/55     10/20 

    3 assignments there so i displays 3 rows. but i need to display in a single row.

    @{
        List<WebGridColumn> cols = new List<WebGridColumn>();
        foreach (GradeBook.StudentGradeBook x in Model.Student)
        {
            cols.Add(grid.Column(format:@<text><a href="javascript:DisplayModalPopup();">@item.FirstName @item.lastName</a></text>, header: "student"));
            cols.Add(grid.Column(format:@<text>@totptsawd/@totptspbl</text>, header: "Total Points"));
            cols.Add(grid.Column(format:@<text>@item.PointsAwarded/@item.PointsPossible</text>, header: x.AssignmentName));
        }
     
    Tuesday, July 16, 2013 4:02 AM

Answers

  • You have accidentally posted your question in Microsoft Project Server specific forum , consider re-posting your question using appropriate forum for faster and expert response.


    Hrishi Deshpande – Senior Consultant DeltaBahn
    Blog | < | LinkedIn

    Please click Mark As Answer; if a post solves your problem or Vote As Helpful if a post has been useful to you.This can be beneficial to other community members reading the thread.

    Tuesday, July 16, 2013 3:23 PM
    Moderator