Sameer More
Sameer More

Reputation: 589

Display webgrid with rowspan IN MVC

How to code webgrid as shown beloW in MVC 3.

h1   |   h2  |  h3
-------------------
R11  |  R12  |  R13
     |-------|------
     |  R22  |  R23
-------------------
R22  |  R21  |  R23
     |-------|------
     |  R22  |  R33

Middle colmn and 3 rd column spans 2 rows each.

Upvotes: 0

Views: 949

Answers (1)

Zach dev
Zach dev

Reputation: 1620

sorry but that kind of requirements it's not possible with Microsoft's WebGrid helper, you just can apply custom text format, style, column name and if can be sortable.

in this case you should go for old way or third party components

and if you want the html, it's like you described "Middle colmun and 3rd colums spans 2 rows each"

<table BORDER=1>
<thead>
    <tr>
    <td>H1</td>
    <td>H2</td>
    <td>H3</td>
    </tr>
</thead>
<tbody>
<tr>
    <td rowspan=2>
        R11
    </td>
    <td>
        R12
    </td>
    <td>
       R13
    </td>
</tr>
<tr>
    <td>
        R22
    </td>
    <td>
        R23
    </td>
</tr>
<tr>
    <td rowspan=2>
        R22
    </td>
    <td>
        R21
    </td>
    <td>
       R23
    </td>
</tr>
<tr>
    <td>
        R22
    </td>
    <td>
        R33
    </td>
</tr>
</tbody>

Upvotes: 1

Related Questions