1

How can I add headers column names with spaces to my asp.net mvc webgrid? Could some one throw some idea on this?

 var str= "ProjectID,ProjectTitle,ProjectDescription";
 var headers = "Project ID,Project Title,Project Description";

    string[] columns = str.Split(',');
    string[] hdrs = headers.Split(',');

    var cols = new List<WebGridColumn>();
    foreach (var column in columns)
    {
        cols.Add(grid.Column(column));
    }

    @grid.GetHtml(columns: cols)

1 Answer 1

1
cols.Add(grid.Column(columnName: "column", header: "Column Name With Spaces"));
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.