Search code examples
asp.net-mvcwebgrid

Webgrid ,first td should be diffrent


I am planing to use Webgrid of MVC3/MVC4

But all my rows in the table should have same column format except for the first one.

In the first row there should be a text box that span all the columns of the table. All other rows should be populated with he list i give as input

How can I achieve this :(


Solution

  •    function createSearchTextBox(){
            var numberOfColumns = $("#grid >table").find("th").length;
            var firstTableRow = "<tr><td id='searchBox'colspan='" + numberOfColumns + "' ><input type='text'></input></td></tr>";
            $("#grid >table tr:first").after(firstTableRow);
            PlaceCheckBoxInHeader();
        }