0

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 :(

Kuttan Sujith
  • 7,889
  • 18
  • 64
  • 95

2 Answers2

1

The only way you can do that currently is with client-side scripting after the grid has rendered. jQuery would be a good option.

Mike Brind
  • 28,238
  • 6
  • 56
  • 88
  • How can i run Some client side script after the table is rendered? – Kuttan Sujith Mar 28 '13 at 05:58
  • How can i get the table rendering completed event – Kuttan Sujith Mar 28 '13 at 05:59
  • There is no event as such. Once your server side code has executed, the HTML is sent to the browser. Once it is displayed there, you can further manipulate the DOM (Document Object Model) using client side scripting. Javascript is the most popular way to do this, and jQuery is a library that makes it easy to work with javascript. – Mike Brind Mar 28 '13 at 06:10
0
   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();
    }
Kuttan Sujith
  • 7,889
  • 18
  • 64
  • 95