I have two columns that I will like to hide in a webgrid. This webgrid resides in a partial view. Here are the columns below
gridColumns.Add(grid.Column("PaymentAmount", header: T("Payment<br/>Amount"), canSort: false, format: item => Html.TextBox("PaymentAmount", (object)string.Format("{0:#,0.00}", item.AmountDue))));
gridColumns.Add(grid.Column("ExpText", header: T("Explanation"), canSort: false, format: item => Html.TextBox("ExpText", "")));
Here is my attempt with jquery below
function hidecolumns(column) {
$('td:nth-child(' + column + '),th:nth-child( ' + column + ')').hide();
}
This does not work. Kindly assist.